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:
Ryan Boren
2010-05-10 00:58:39 +00:00
parent 58837ee989
commit ee0b76261b
3 changed files with 16 additions and 6 deletions

View File

@@ -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];