get_comment_count


get_comment_count ( $post_id = 0 )

Parameters:
  • (int) $post_id Optional. Comment amount in post if > 0, else total comments blog wide.
Returns:
  • (array) The amount of spam, approved, awaiting moderation, and total comments.
Defined at:

Description

The amount of comments in a post or total comments.

A lot like wp_count_comments(), in that they both return comment stats (albeit with different types). The wp_count_comments() actually caches, but this function does not.

Related Functions

get_comment_pages_count, get_comment_author, get_comment_date, get_comment_guid, get_comment_meta

Top Google Results

User discussions

wpseek mobile