apply_filters( 'get_page_of_comment', int $page, array $args, array $original_args, int $comment_id )
- Since
- 4.4.0, 4.7.0
Filters the calculated page on which a comment appears.
Compatibility
- WordPress
- since 4.7.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
$pageint- Comment page.
$argsarray- { Arguments used to calculate pagination. These include arguments auto-detected by the function, based on query vars, system settings, etc. For pristine arguments passed to the function, see
$original_args.
@type string $type Type of comments to count.
@type int $page Calculated current page.
@type int $per_page Calculated number of comments per page.
@type int $max_depth Maximum comment threading depth allowed.
}$typestringType of comments to count.$pageintCalculated current page.$per_pageintCalculated number of comments per page.$max_depthintMaximum comment threading depth allowed.
$original_argsarray- { Array of arguments passed to the function. Some or all of these may not be set.
@type string $type Type of comments to count.
@type int $page Current comment page.
@type int $per_page Number of comments per page.
@type int $max_depth Maximum comment threading depth allowed.
}$typestringType of comments to count.$pageintCurrent comment page.$per_pageintNumber of comments per page.$max_depthintMaximum comment threading depth allowed.
$comment_idint- ID of the comment.
Where this hook fires · 1
wp-includes/comment.php:1194get_page_of_comment()
Source code
* @type int $page Current comment page. * @type int $per_page Number of comments per page. * @type int $max_depth Maximum comment threading depth allowed. * } * @param int $comment_id ID of the comment. */ return apply_filters( 'get_page_of_comment', (int) $page, $args, $original_args, $comment_id );} /** * Retrieves the maximum character lengths for the comment form fields. * * @since 4.5.0Changelog
Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.7.0
Introduced the
$comment_id parameter.from the docblock4.4.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 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.