found_posts filter-hookWP 2.1.0

Filters the number of found posts for the query.

Usage

add_filter( 'found_posts', 'wp_kama_found_posts_filter', 10, 2 );

/**
 * Function for `found_posts` filter-hook.
 * 
 * @param int      $found_posts The number of posts found.
 * @param WP_Query $query       The WP_Query instance (passed by reference).
 *
 * @return int
 */
function wp_kama_found_posts_filter( $found_posts, $query ){

	// filter...
	return $found_posts;
}
$found_posts(int)
The number of posts found.
$query(WP_Query)
The WP_Query instance (passed by reference).

Changelog

Since 2.1.0 Introduced.

Where the hook is called

WP_Query::set_found_posts()
found_posts
wp-includes/class-wp-query.php 3402
$this->found_posts = (int) apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );

Where the hook is used in WordPress

Usage not found.