Ticket #14426: 14426.patch
| File 14426.patch, 981 bytes (added by , 13 years ago) |
|---|
-
wp-includes/query.php
2642 2642 $ids = $wpdb->get_col( $this->request ); 2643 2643 2644 2644 if ( $ids ) { 2645 $this->posts = $ids; 2645 2646 $this->set_found_posts( $q, $limits ); 2646 2647 _prime_post_caches( $ids, $q['update_post_term_cache'], $q['update_post_meta_cache'] ); 2647 $this->posts = $ids;2648 2648 } else { 2649 2649 $this->posts = array(); 2650 $this->found_posts = $this->max_num_pages = 0;2651 2650 } 2652 2651 } else { 2653 2652 $this->posts = $wpdb->get_results( $this->request ); … … 2770 2769 function set_found_posts( $q, $limits ) { 2771 2770 global $wpdb; 2772 2771 2773 if ( $q['no_found_rows'] || empty( $limits ) )2772 if ( $q['no_found_rows'] || empty( $limits ) || ! $this->posts ) 2774 2773 return; 2775 2774 2776 2775 $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );