wp_count_posts filter-hook . WP 3.7.0
Modify returned post counts by status for the current post type.
Usage
add_filter( 'wp_count_posts', 'filter_function_name_1135', 10, 3 ); function filter_function_name_1135( $counts, $type, $perm ){ // filter... return $counts; }
- $counts(object)
- An object containing the current post_type's post counts by status.
- $type(string)
- Post type.
- $perm(string)
- The permission to determine if the posts are 'readable' by the current user.
Changelog
Since 3.7.0 | Introduced. |
Where the hook is called
wp_count_posts
wp-includes/post.php 2710
return apply_filters( 'wp_count_posts', $counts, $type, $perm );
wp-includes/post.php 2672
return apply_filters( 'wp_count_posts', $counts, $type, $perm );