Add Filter posts_results using WP_Query
-
I’m learning how to create Plugin in WordPress and I have a question about how to filter posts using ‘posts_results’ hook and WP_Query inside the function.
How can I filter $results in the code below by WP_Query?add_filter( ‘posts_results’, ‘gp_custom_home_page_posts’ );
function gp_custom_home_page_posts( $results ) {
….
return $results;
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Add Filter posts_results using WP_Query’ is closed to new replies.