Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: comments_template_top_level_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
1444                 * @param array $top_level_args {
1445                 *     The top level query arguments for the comments template.
1446                 *
1447                 *     @type bool         $count   Whether to return a comment count.
1448                 *     @type string|array $orderby The field(s) to order by.
1449                 *     @type int          $post_id The post ID.
1450                 *     @type string|array $status  The comment status to limit results by.
1451                 * }
1452                 */
1453                $top_level_args = apply_filters( 'comments_template_top_level_query_args', $top_level_args );
1454
1455                $top_level_count = $top_level_query->query( $top_level_args );
1456
1457                $comment_args['offset'] = ( ceil( $top_level_count / $per_page ) - 1 ) * $per_page;
1458           }
1459      }
1460
1461      /**
1462       * Filters the arguments used to query comments in comments_template().