Uses
Uses | Description |
---|---|
wp-includes/class-wp-comment-query.php: WP_Comment_Query::get_comments() | Get a list of comments matching the query vars. |
wp-includes/functions.php: wp_parse_args() | Merge user defined arguments into defaults array. |
Sets up the WordPress query for retrieving comments.
(string|array) (Required) Array or URL query string of parameters.
(array|int) List of comments, or number of comments when 'count' is passed as a query var.
File: wp-includes/class-wp-comment-query.php
public function query( $query ) { $this->query_vars = wp_parse_args( $query ); return $this->get_comments(); }
Version | Description |
---|---|
4.2.0 | Moved parsing to WP_Comment_Query::parse_query(). |
4.1.0 | Introduced 'comment__in', 'comment__not_in', 'post_author__in', 'post_author__not_in', 'author__in', 'author__not_in', 'post__in', 'post__not_in', 'include_unapproved', 'type__in', and 'type__not_in' arguments to $query_vars. |
3.1.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_comment_query/query