Ticket #32504: 32504-dontcache-max_num_pages.diff
| File 32504-dontcache-max_num_pages.diff, 1.3 KB (added by , 10 years ago) |
|---|
-
src/wp-includes/class-wp-network-query.php
229 229 $cache_value = array( 230 230 'network_ids' => $network_ids, 231 231 'found_networks' => $this->found_networks, 232 'max_num_pages' => $this->max_num_pages,233 232 ); 234 233 wp_cache_add( $cache_key, $cache_value, 'networks' ); 235 234 } else { 236 235 $network_ids = $cache_value['network_ids']; 237 236 $this->found_networks = $cache_value['found_networks']; 238 $this->max_num_pages = $cache_value['max_num_pages'];239 237 } 240 238 239 if ( $this->found_networks && $this->query_vars['number'] ) { 240 $this->max_num_pages = ceil( $this->found_networks / $this->query_vars['number'] ); 241 } 242 241 243 // If querying for a count only, there's nothing more to do. 242 244 if ( $this->query_vars['count'] ) { 243 245 // $network_ids is actually a count in this case. … … 477 479 $found_networks_query = apply_filters( 'found_networks_query', 'SELECT FOUND_ROWS()', $this ); 478 480 479 481 $this->found_networks = (int) $wpdb->get_var( $found_networks_query ); 480 $this->max_num_pages = ceil( $this->found_networks / $this->query_vars['number'] );481 482 } 482 483 } 483 484
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)