Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: comments_template_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
1452       *                                                   will be included in results.
1453       *     @type int          $post_id                   ID of the post.
1454       *     @type bool         $no_found_rows             Whether to refrain from querying for found rows.
1455       *     @type bool         $update_comment_meta_cache Whether to prime cache for comment meta.
1456       *     @type bool|string  $hierarchical              Whether to query for comments hierarchically.
1457       *     @type int          $offset                    Comment offset.
1458       *     @type int          $number                    Number of comments to fetch.
1459       * }
1460       */
1461      $comment_args  = apply_filters( 'comments_template_query_args', $comment_args );
1462      $comment_query = new WP_Comment_Query( $comment_args );
1463      $_comments     = $comment_query->comments;
1464
1465      // Trees must be flattened before they're passed to the walker.
1466      if ( $comment_args['hierarchical'] ) {
1467           $comments_flat = array();
1468           foreach ( $_comments as $_comment ) {
1469                $comments_flat[]  = $_comment;
1470                $comment_children = $_comment->get_children(