描述
获取整个网站或某篇文章的评论数量。
使用方法
参数
$post_id
(integer) (可选) :需要统计评论数量的文章ID
默认: None
返回值
返回已批准的、审核中的、垃圾评论、和已删除评论的数量。
使用示例
默认使用方法
获取一个网站的评论数量。
"; echo "审核中: " . $comments_count->moderated . "
"; echo "已批准: " . $comments_count->approved . "
"; echo "垃圾评论: " . $comments_count->spam . "
"; echo "已删除评论: " . $comments_count->trash . "
"; echo "评论总数: " . $comments_count->total_comments . "
"; ?>
获取某篇文章的评论数量
的评论数量:"; echo “审核中” . $comments_count->moderated . "
"; echo "已批准量: " . $comments_count->approved . "
"; echo "垃圾评论:" . $comments_count->spam . "
"; echo "已删除评论: " . $comments_count->trash . "
"; echo "评论总数: " . $comments_count->total_comments . "
"; ?>