get_page_of_comment( int $comment_id, array $args = array() ): int|null

Calculates what page number a comment will appear on for comment paging.


$comment_id int Required
Comment ID.
$args array Optional
Array of optional arguments.
  • type string
    Limit paginated comments to those matching a given type.
    Accepts 'comment', 'trackback', 'pingback', 'pings' (trackbacks and pingbacks), or 'all'. Default 'all'.
  • per_page int
    Per-page count to use when calculating pagination.
    Defaults to the value of the 'comments_per_page' option.
  • max_depth int|string
    If greater than 1, comment page will be determined for the top-level parent $comment_id.
    Defaults to the value of the 'thread_comments_depth' option.