apply_filters( 'get_page_of_comment_query_args', array $comment_args )
- Since
- 5.5.0
Filters the arguments used to query comments in get_page_of_comment().
Compatibility
- WordPress
- since 5.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$comment_argsarray- { Array of WP_Comment_Query arguments.
@type string $type Limit paginated comments to those matching a given type.
Accepts 'comment', 'trackback', 'pingback', 'pings' (trackbacks and pingbacks), or 'all'. Default 'all'.
@type int $post_id ID of the post.
@type string $fields Comment fields to return.
@type bool $count Whether to return a comment count (true) or array of comment objects (false).
@type string $status Comment status.
@type int $parent Parent ID of comment to retrieve children of.
@type array $date_query Date query clauses to limit comments by. See WP_Date_Query.
@type array $include_unapproved Array of IDs or email addresses whose unapproved comments will be included in paginated comments.
}$typestringLimit paginated comments to those matching a given type. Accepts 'comment', 'trackback', 'pingback', 'pings' (trackbacks and pingbacks), or 'all'. Default 'all'.$post_idintID of the post.$fieldsstringComment fields to return.$countboolWhether to return a comment count (true) or array of comment objects (false).$statusstringComment status.$parentintParent ID of comment to retrieve children of.$date_queryarrayDate query clauses to limit comments by. See WP_Date_Query.$include_unapprovedarrayArray of IDs or email addresses whose unapproved comments will be included in paginated comments.
Where this hook fires · 1
wp-includes/comment.php:1210get_page_of_comment()
Source code
* @type int $parent Parent ID of comment to retrieve children of. * @type array $date_query Date query clauses to limit comments by. See WP_Date_Query. * @type array $include_unapproved Array of IDs or email addresses whose unapproved comments * will be included in paginated comments. * } */ $comment_args = apply_filters( 'get_page_of_comment_query_args', $comment_args ); $comment_query = new WP_Comment_Query(); $older_comment_count = $comment_query->query( $comment_args ); // No older comments? Then it's page #1. if ( 0 === $older_comment_count ) {Changelog
Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.