wp_count_comments


wp_count_comments ( $post_id = 0 )

Parameters:
  • (int) $post_id Optional. Restrict the comment counts to the given post. Default 0, which indicates that comment counts for the whole site will be retrieved.
See:
Returns:
  • (stdClass) { The number of comments keyed by their status.
Defined at:

Description

Retrieves the total comment counts for the whole site or a single post.

The comment stats are cached and then retrieved, if they already exist in the cache.

Related Functions

wp_count_attachments, wp_untrash_comment, wp_list_comments, wp_count_posts, wp_new_comment

Top Google Results

User discussions

wpseek mobile