get_page_of_comment WordPress Filter Hook

The get_page_of_comment WordPress hook is used to "find the page number a comment is on." In other words, it helps you determine which page a particular comment is located on your website or blog. This can be useful if you want to direct a reader to a specific comment, or if you want to keep track of comments on a specific page.

apply_filters( 'get_page_of_comment', int $page, array $args, array $original_args, int $comment_ID ) #

Filters the calculated page on which a comment appears.


Parameters

$page

(int)Comment page.

$args

(array)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 of comments to count.
  • 'page'
    (int) Calculated current page.
  • 'per_page'
    (int) Calculated number of comments per page.
  • 'max_depth'
    (int) Maximum comment threading depth allowed.

$original_args

(array)Array of arguments passed to the function. Some or all of these may not be set.

  • 'type'
    (string) Type of comments to count.
  • 'page'
    (int) Current comment page.
  • 'per_page'
    (int) Number of comments per page.
  • 'max_depth'
    (int) Maximum comment threading depth allowed.

$comment_ID

(int)ID of the comment.


Top ↑

Source

File: wp-includes/comment.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced the $comment_ID parameter.
4.4.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