wp_count_comments WordPress Filter Hook

The wp_count_comments hook is used to return the number of comments for a given post. This can be useful for displaying the number of comments on a post, or for displaying the number of comments on a post with a particular tag.

apply_filters( 'wp_count_comments', array|stdClass $count, int $post_id ) #

Filters the comments count for a given post or the whole site.


Parameters

$count

(array|stdClass)An empty array or an object containing comment counts.

$post_id

(int)The post ID. Can be 0 to represent the whole site.


Top ↑

Source

File: wp-includes/comment.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.7.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