Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_page_of_comment_query_args

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1172            *     @type bool   $count              Whether to return a comment count (true) or array
1173            *                                      of comment objects (false).
1174            *     @type string $status             Comment status.
1175            *     @type int    $parent             Parent ID of comment to retrieve children of.
1176            *     @type array  $date_query         Date query clauses to limit comments by. See WP_Date_Query.
1177            *     @type array  $include_unapproved Array of IDs or email addresses whose unapproved comments
1178            *                                      will be included in paginated comments.
1179            * }
1180            */
1181           $comment_args = apply_filters( 'get_page_of_comment_query_args', $comment_args );
1182
1183           $comment_query       = new WP_Comment_Query();
1184           $older_comment_count = $comment_query->query( $comment_args );
1185
1186           // No older comments? Then it's page #1.
1187           if ( 0 == $older_comment_count ) {
1188                $page = 1;
1189
1190                // Divide comments older than this one by comments per page to get this comment's page number.