posts_results
Filters the raw post results array, prior to status checks.
Usage
add_filter( 'posts_results', 'wp_kama_posts_results_filter' );
/**
* Function for `posts_results` filter-hook.
*
* @param WP_Post[] $posts Array of post objects.
*
* @return WP_Post[]
*/
function wp_kama_posts_results_filter( $posts ){
// filter...
return $posts;
}
- $posts(WP_Post[])
- Array of post objects.
Changelog
| Since 2.3.0 | Introduced. |
Where the hook is called
posts_results
wp-includes/class-wp-query.php 3468
$this->posts = apply_filters_ref_array( 'posts_results', array( $this->posts, &$this ) );