wppaste
WordPress

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.
}
  • $typestring

    Limit paginated comments to those matching a given type. Accepts 'comment', 'trackback', 'pingback', 'pings' (trackbacks and pingbacks), or 'all'. Default 'all'.
  • $post_idint

    ID of the post.
  • $fieldsstring

    Comment fields to return.
  • $countbool

    Whether to return a comment count (true) or array of comment objects (false).
  • $statusstring

    Comment status.
  • $parentint

    Parent ID of comment to retrieve children of.
  • $date_queryarray

    Date query clauses to limit comments by. See WP_Date_Query.
  • $include_unapprovedarray

    Array of IDs or email addresses whose unapproved comments will be included in paginated comments.

Where this hook fires · 1

  • wp-includes/comment.php:1112get_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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 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.