Ticket #15400: 15400-1-reduce-to-one-query-when-pagination-disabled.patch
File 15400-1-reduce-to-one-query-when-pagination-disabled.patch, 747 bytes (added by , 15 years ago) |
---|
-
wp-includes/default-widgets.php
650 650 $number = 1; 651 651 652 652 $comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) ); 653 $posts = array(); 654 foreach ( (array) $comments as $comment) { 655 $posts[] = $comment->comment_post_ID; 656 } 657 $posts = array_unique($posts); 658 get_posts( array( 'post__in' => $posts, 'numberposts' => -1, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'posts_per_page' => -1 ) ); 653 659 $output .= $before_widget; 654 660 if ( $title ) 655 661 $output .= $before_title . $title . $after_title;