get_comments_number WordPress Filter Hook
The get_comments_number hook is used to get the number of comments for a post. This can be useful for displaying the number of comments next to the post title, or for creating a custom callback function to display the number of comments in a different way.
apply_filters( 'get_comments_number', string|int $count , int $post_id ) #
Filters the returned comment count for a post.
Parameters
- $count
(string|int)A string representing the number of comments a post has, otherwise 0.
- $post_id
(int)Post ID.
Source
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |