get_comment_count


get_comment_count ( $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.
Returns:
  • (array()) { The number of comments keyed by their status.
Defined at:

Description

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

Unlike wp_count_comments(), this function always returns the live comment counts without caching.

Related Functions

get_comment_pages_count, get_comment_author, get_comment_guid, get_comment_link, get_comment_meta

Top Google Results

User discussions

wpseek mobile