Ticket #12611: update_post_caches.diff
File update_post_caches.diff, 1.2 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
3993 3993 update_post_cache($posts); 3994 3994 3995 3995 $post_ids = array(); 3996 foreach ( $posts as $post ) 3997 $post_ids[] = $post->ID; 3996 3998 3997 for ($i = 0; $i < count($posts); $i++)3998 $post_ids[] = $posts[$i]->ID;3999 4000 3999 update_object_term_cache($post_ids, 'post'); 4001 4000 4002 4001 update_postmeta_cache($post_ids); -
wp-includes/query.php
1626 1626 if ( !isset($q['suppress_filters']) ) 1627 1627 $q['suppress_filters'] = false; 1628 1628 1629 if ( !isset($q['cache_results']) ) 1630 $q['cache_results'] = true; 1631 1629 1632 if ( !isset($q['post_type']) ) { 1630 1633 if ( $this->is_search ) 1631 1634 $q['post_type'] = 'any'; … … 2499 2502 $this->posts[$i] = sanitize_post($this->posts[$i], 'raw'); 2500 2503 } 2501 2504 2502 update_post_caches($this->posts); 2505 if ( $q['cache_results'] ) 2506 update_post_caches($this->posts); 2503 2507 2504 2508 if ($this->post_count > 0) { 2505 2509 $this->post = $this->posts[0];