posts_results filter-hookWP 2.3.0

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

WP_Query::get_posts()
posts_results
wp-includes/class-wp-query.php 3373
$this->posts = apply_filters_ref_array( 'posts_results', array( $this->posts, &$this ) );

Where the hook is used in WordPress

Usage not found.