get_comments_number( int|WP_Post $post )
Retrieves the amount of comments a post has.
Parameters
- $post
-
(Optional) Post ID or WP_Post object. Default is the global
$post
.
Return
(string|int) If the post exists, a numeric string representing the number of comments the post has, otherwise 0.
Source
File: wp-includes/comment-template.php
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |