Я думаю, что это правильный способ сделать это:
function yclads_posts_where_followed_authors($where) {
global $wpdb;
$authors_ids = array(0,1,2,3);//array of authors IDs
if (count($authors_ids) > 0)
{
$where .= ' AND ' . $wpdb->posts . '.post_author IN(' . implode (',',$authors_ids) . ') ';
}
else
{
$where .= ' AND 1=2'; //do not return results
}
return $where;
}
add_filter('posts_where', 'posts_where_filter_authors');