comments_template_top_level_query_args
Filters the arguments used in the top level comments query.
Usage
add_filter( 'comments_template_top_level_query_args', 'wp_kama_comments_template_top_level_query_args_filter' ); /** * Function for `comments_template_top_level_query_args` filter-hook. * * @param array $top_level_args The top level query arguments for the comments template. * * @return array */ function wp_kama_comments_template_top_level_query_args_filter( $top_level_args ){ // filter... return $top_level_args; }
- $top_level_args(array)
The top level query arguments for the comments template.
-
count(true|false)
Whether to return a comment count. -
orderby(string|array)
The field(s) to order by. -
post_id(int)
The post ID. - status(string|array)
The comment status to limit results by.
-
Changelog
Since 5.6.0 | Introduced. |
Where the hook is called
wp-includes/comment-template.php 1522
$top_level_args = apply_filters( 'comments_template_top_level_query_args', $top_level_args );