comments_number() WP 1.0
Display the language string for the number of comments the current post has.
Works based on: get_comments_number_text()
1 time = 0.000071s = very fast | 50000 times = 1.61s = fast
No Hooks.
Return
Null. Nothing.
Usage
comments_number( $zero, $one, $more, $post_id );
- $zero(string)
- Text for no comments.
Default: false - $one(string)
- Text for one comment.
Default: false - $more(string)
- Text for more than one comment.
Default: false - $post_id(int/WP_Post)
- Post ID or WP_Post object.
Default: global $post
Changelog
Since 0.71 | Introduced. |
Since 5.4.0 | The $deprecated parameter was changed to $post_id. |
Code of comments_number() comments number WP 5.6
function comments_number( $zero = false, $one = false, $more = false, $post_id = 0 ) {
echo get_comments_number_text( $zero, $one, $more, $post_id );
}Related Functions
From category: Comments
- cancel_comment_reply_link()
- comment_author_email_link()
- comment_form()
- comment_form_title()
- comment_id_fields()
- comment_text()
- comment_type()
- comments_link()
- comments_popup_link()
- get_avatar()
- get_avatar_data()
- get_avatar_url()
- get_cancel_comment_reply_link()
- get_comment()
- get_comment_author_email()
- get_comment_pages_count()
- get_comment_reply_link()
- get_comment_text()
- get_comment_type()
- get_comments()
- get_comments_link()
- get_comments_number()
- get_comments_pagenum_link()
- get_edit_comment_link()
- get_next_comments_link()
- get_page_of_comment()
- get_previous_comments_link()
- get_the_comments_navigation()
- get_the_comments_pagination()
- is_comment_feed()
- is_trackback()
- next_comments_link()
- paginate_comments_links()
- previous_comments_link()
- sanitize_comment_cookies()
- the_comments_navigation()
- the_comments_pagination()
- wp_allow_comment()
- wp_count_comments()
- wp_delete_comment()
- wp_get_current_commenter()
- wp_handle_comment_submission()
- wp_insert_comment()
- wp_list_comments()
- wp_new_comment()
- wp_notify_moderator()
- wp_notify_postauthor()
- wp_set_comment_cookies()
- wp_set_comment_status()
- wp_spam_comment()
- wp_transition_comment_status()
- wp_update_comment()
- wp_update_comment_count()