posts - post__in no longer works in wordpress 5.0.3

admin2025-06-02  2

I recently updated Wordpress to 5.0.3 and I got a problem on post__in, in particular I have this $query:

$query = array(
        'post_type'             => array('post'),
        'showposts'             => $instance['posts_num'],
        'cat'                   => $instance['posts_cat_id'],
        'ignore_sticky_posts'   => true,
        'orderby'               => $instance['posts_orderby'],
        'order'                 => 'dsc',
        'date_query' => array(
            array(
                'after' => $instance['posts_time'],
            ),
        ),
        'post__in' => array()
    );

if(!empty($instance["posts_specific"]))
{
    $query["post__in"] = explode(',', $instance["posts_specific"]);
}

for some reasons the widget doesn't display anymore the post specified in posts_specific, eg: 5435 (before all this mechanism worked).

I pasted here the full class. What is changed? I can't see anything reported in the official changelog.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748801324a313833.html

最新回复(0)