found_posts
Filters the number of found posts for the query.
Использование
add_filter( 'found_posts', 'wp_kama_found_posts_filter' );
/**
* Function for `found_posts` filter-hook.
*
* @param int $found_posts The number of posts found.
*
* @return int
*/
function wp_kama_found_posts_filter( $found_posts ){
// filter...
return $found_posts;
}
- $found_posts(int)
- The number of posts found.
Список изменений
| С версии 2.1.0 | Введена. |
Где вызывается хук
found_posts
wp-includes/class-wp-query.php 3723
$this->found_posts = (int) apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );