Append argument not working in the wp_get_recent_posts function

I want to append some WP posts to the normal search function but when I run the wp_get_recent_posts function (with the append and the posts IDs in an array) I dont get the posts I wanted to append in the results, am I doing something wrong?

$include = array(1, 2);

$args = array(
   'showposts' => 10, 
   'tag_id' => '123',
   'post_status' => 'publish',
   'exclude' => $current_id,
   'orderby' => 'post_date',
   'append' => $include,
);
    
$entries = wp_get_recent_posts($args, 'ARRAY_A');

If I remove the tag_id argument then the posts I want to append are included in the results, seems that WP also filters the appended posts with the other arguments, is there any workaround?

Related posts

Leave a Reply