I was wondering if there is a way to use WP_Query (get_posts, etc.) to return messages with an identifier greater than the one provided.
I went through the WordPress code and skipped links to requests related to the post id, if possible even without a custom request.
Since it doesn't allow you to skip it with arguments, I tried to write a method that modifies the posts_where filter, but this does not seem to work.
add_filter( 'posts_where', 'filter_since_id');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
endwhile;
remove_filter('posts_where' , 'filter_since_id');
...
function filter_since_id($where = ''){
$where .= " AND ID > 3'";
return $where;
}
source
share