Ticket #31081: 31081.diff
File 31081.diff, 2.2 KB (added by , 10 years ago) |
---|
-
src/wp-includes/comment.php
771 771 return array_map( 'intval', $this->comments ); 772 772 } 773 773 774 774 $results = $wpdb->get_results( $this->request ); 775 775 /** 776 776 * Filter the comment query results. 777 777 * 778 778 * @since 3.1.0 779 779 * 780 780 * @param array $results An array of comments. 781 781 * @param WP_Comment_Query &$this Current instance of WP_Comment_Query, passed by reference. 782 782 */ 783 783 $comments = apply_filters_ref_array( 'the_comments', array( $results, &$this ) ); 784 784 785 785 wp_cache_add( $cache_key, $comments, 'comment' ); 786 if ( '*' == $fields ) { 787 update_comment_cache( $comments ); 788 } 786 789 787 790 return $comments; 788 791 } 789 792 790 793 /** 791 794 * Used internally to generate an SQL string for searching across multiple columns 792 795 * 793 796 * @access protected 794 797 * @since 3.1.0 795 798 * 796 799 * @param string $string 797 800 * @param array $cols 798 801 * @return string 799 802 */ 800 803 protected function get_search_sql( $string, $cols ) { -
src/wp-includes/comment-template.php
1172 1172 } 1173 1173 1174 1174 $comments = get_comments( $comment_args ); 1175 1175 1176 1176 /** 1177 1177 * Filter the comments array. 1178 1178 * 1179 1179 * @since 2.1.0 1180 1180 * 1181 1181 * @param array $comments Array of comments supplied to the comments template. 1182 1182 * @param int $post_ID Post ID. 1183 1183 */ 1184 1184 $wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID ); 1185 1185 $comments = &$wp_query->comments; 1186 1186 $wp_query->comment_count = count($wp_query->comments); 1187 update_comment_cache($wp_query->comments);1188 1187 1189 1188 if ( $separate_comments ) { 1190 1189 $wp_query->comments_by_type = separate_comments($comments); 1191 1190 $comments_by_type = &$wp_query->comments_by_type; 1192 1191 } 1193 1192 1194 1193 $overridden_cpage = false; 1195 1194 if ( '' == get_query_var('cpage') && get_option('page_comments') ) { 1196 1195 set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 ); 1197 1196 $overridden_cpage = true; 1198 1197 } 1199 1198 1200 1199 if ( !defined('COMMENTS_TEMPLATE') ) 1201 1200 define('COMMENTS_TEMPLATE', true); 1202 1201