mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
Allow turning off object_term and postmeta cache updates. Turn off object_term updates in the wp_get_nav_menu_items() get_posts() query to avoid useless taxonomy query.
git-svn-id: https://develop.svn.wordpress.org/trunk@14528 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1621,6 +1621,12 @@ class WP_Query {
|
||||
if ( !isset($q['cache_results']) )
|
||||
$q['cache_results'] = true;
|
||||
|
||||
if ( !isset($q['update_post_term_cache']) )
|
||||
$q['update_post_term_cache'] = true;
|
||||
|
||||
if ( !isset($q['update_post_meta_cache']) )
|
||||
$q['update_post_meta_cache'] = true;
|
||||
|
||||
if ( !isset($q['post_type']) ) {
|
||||
if ( $this->is_search )
|
||||
$q['post_type'] = 'any';
|
||||
@@ -2504,7 +2510,7 @@ class WP_Query {
|
||||
}
|
||||
|
||||
if ( $q['cache_results'] )
|
||||
update_post_caches($this->posts, $post_type);
|
||||
update_post_caches($this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache']);
|
||||
|
||||
if ( $this->post_count > 0 ) {
|
||||
$this->post = $this->posts[0];
|
||||
|
||||
Reference in New Issue
Block a user