Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: comments_array

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
1123
1124      /**
1125       * Filter the comments array.
1126       *
1127       * @since 2.1.0
1128       *
1129       * @param array $comments Array of comments supplied to the comments template.
1130       * @param int   $post_ID  Post ID.
1131       */
1132      $wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID );
1133      $comments = &$wp_query->comments;
1134      $wp_query->comment_count = count($wp_query->comments);
1135      update_comment_cache($wp_query->comments);
1136
1137      if ( $separate_comments ) {
1138           $wp_query->comments_by_type = separate_comments($comments);
1139           $comments_by_type = &$wp_query->comments_by_type;
1140      }
1141