WPDev.one
Core Function
View Source on Trac ↗

get_comment_count()

get_comment_count( mixed $post_id = 0 )

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

Parameters 1 required

Name / Type Description
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.

Required

Return Value

(int[])
int[] { The number of comments keyed by their status.

Function Information

Since Version
2.0.0
Source File
wp-includes/comment.php
Advertisement