wp_count_comments()
Retrieve total comments for blog or single post.
The comment stats are cached and then retrieved, if they already exist in the cache.
Uses: get_comment_count()
Hooks from the function
Return
stdClass
. The number of comments keyed by their status.
Usage
wp_count_comments( $post_id );
- $post_id(int)
- Restrict the comment counts to the given post.
Default: 0, which indicates that comment counts for the whole site will be retrieved
Notes
- See: get_comment_count() Which handles fetching the live comment counts.
Changelog
Since 2.5.0 | Introduced. |