get_comments_number filter-hook . WP 1.5.0
Filters the returned comment count for a post.
Usage
add_filter( 'get_comments_number', 'filter_function_name_5516', 10, 2 ); function filter_function_name_5516( $count, $post_id ){ // filter... return $count; }
- $count(string/int)
- A string representing the number of comments a post has, otherwise 0.
- $post_id(int)
- Post ID.
Changelog
Since 1.5.0 | Introduced. |
Where the hook is called
get_comments_number
wp-includes/comment-template.php 872
return apply_filters( 'get_comments_number', $count, $post_id );