get_comment_count()
get_comment_count( int $post_id )
检索整个网站或单个帖子的评论总数。
Retrieves the total comment counts for the whole site or a single post.
说明(Description)
与wp_count_comments()不同,此函数始终返回不带缓存的实时注释计数。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post_id | (int) | 可选 | 将评论计数限制为给定的文章。默认值为0,表示将检索整个网站的评论计数。 |
返回(Return)
顶部810
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.0.0 | wp-includes/comment.php:380 | 1 function | 2 |
get_comment_count() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_comment_count/