comments_template_query_args WordPress Filter Hook

The comments_template_query_args hook allows you to modify the query arguments used when retrieving comments for a post. This can be useful if you want to show only certain types of comments, or comments from a certain time period.

apply_filters( 'comments_template_query_args', array $comment_args ) #

Filters the arguments used to query comments in comments_template().


Description

Top ↑

See also


Top ↑

Parameters

$comment_args

(array)Array of WP_Comment_Query arguments.

  • 'orderby'
    (string|array) Field(s) to order by.
  • 'order'
    (string) Order of results. Accepts 'ASC' or 'DESC'.
  • 'status'
    (string) Comment status.
  • 'include_unapproved'
    (array) Array of IDs or email addresses whose unapproved comments will be included in results.
  • 'post_id'
    (int) ID of the post.
  • 'no_found_rows'
    (bool) Whether to refrain from querying for found rows.
  • 'update_comment_meta_cache'
    (bool) Whether to prime cache for comment meta.
  • 'hierarchical'
    (bool|string) Whether to query for comments hierarchically.
  • 'offset'
    (int) Comment offset.
  • 'number'
    (int) Number of comments to fetch.


Top ↑

Source

File: wp-includes/comment-template.php

View on Trac



Top ↑

Changelog

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