comments_number WordPress Filter Hook

The comments_number WordPress hook is used to display the number of comments for a particular post. This can be useful for keeping track of how popular a post is, or for displaying the number of comments on a post in a list of posts.

apply_filters( 'comments_number', string $output, int $number ) #

Filters the comments count for display.


Description

Top ↑

See also


Top ↑

Parameters

$output

(string)A translatable string formatted based on whether the count is equal to 0, 1, or 1+.

$number

(int)The number of post comments.


Top ↑

Source

File: wp-includes/comment-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More