WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/comments array

Description

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

Usage

<?php function shuffle_comments$comments $post_id ){ return shuffle$comments ); }

add_filter'comments_array' 'shuffle_comments' 10); ?>

Parameters

$comments
(mixed) (required) Array of all comment objects in current query.
Default: None
$post_id
(int) (required) The post id that the comments go with
Default: None


Examples

Notes

Change Log

Source File

comments_array is located in wp-includes/comment-template.php.

Related

comment_save_pre, pre_comment_approved, pre_comment_content, preprocess_comment, wp_allow_comment()

See Also

Plugin_API/Filter_Reference