Ticket #35791: 35791-dontcache-max_num_pages.diff
File 35791-dontcache-max_num_pages.diff, 1.2 KB (added by , 9 years ago) |
---|
-
src/wp-includes/class-wp-site-query.php
264 264 265 265 $cache_value = array( 266 266 'site_ids' => $site_ids, 267 'found_sites' => $this->found_sites, 268 'max_num_pages' => $this->max_num_pages, 267 'found_sites' => $this->found_sites 269 268 ); 270 269 wp_cache_add( $cache_key, $cache_value, 'sites' ); 271 270 } else { 272 271 $site_ids = $cache_value['site_ids']; 273 272 $this->found_sites = $cache_value['found_sites']; 274 $this->max_num_pages = $cache_value['max_num_pages'];275 273 } 276 274 275 if ( $this->found_sites && $this->query_vars['number'] ) { 276 $this->max_num_pages = ceil( $this->found_sites / $this->query_vars['number'] ); 277 } 278 277 279 // If querying for a count only, there's nothing more to do. 278 280 if ( $this->query_vars['count'] ) { 279 281 // $site_ids is actually a count in this case. … … 588 590 $found_sites_query = apply_filters( 'found_sites_query', 'SELECT FOUND_ROWS()', $this ); 589 591 590 592 $this->found_sites = (int) $wpdb->get_var( $found_sites_query ); 591 $this->max_num_pages = ceil( $this->found_sites / $this->query_vars['number'] );592 593 } 593 594 } 594 595