comments_array WordPress Filter Hook

The comments_array hook is used to modify the comments array before it is used to generate comment HTML. This can be useful for adding extra data to each comment, or for modifying existing comment data.

apply_filters( 'comments_array', array $comments, int $post_ID ) #

Filters the comments array.


Parameters

$comments

(array)Array of comments supplied to the comments template.

$post_ID

(int)Post ID.


Top ↑

More Information

Used inside comments_template that allows you to catch all the comments going through the query for the post.


Top ↑

Source

File: wp-includes/comment-template.php

View on Trac



Top ↑

Changelog

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