Make WordPress Core


Ignore:
Timestamp:
05/10/2010 12:58:39 AM (15 years ago)
Author:
ryan
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r14499 r14528  
    16221622            $q['cache_results'] = true;
    16231623
     1624        if ( !isset($q['update_post_term_cache']) )
     1625            $q['update_post_term_cache'] = true;
     1626
     1627        if ( !isset($q['update_post_meta_cache']) )
     1628            $q['update_post_meta_cache'] = true;
     1629
    16241630        if ( !isset($q['post_type']) ) {
    16251631            if ( $this->is_search )
     
    25052511
    25062512        if ( $q['cache_results'] )
    2507             update_post_caches($this->posts, $post_type);
     2513            update_post_caches($this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache']);
    25082514
    25092515        if ( $this->post_count > 0 ) {
Note: See TracChangeset for help on using the changeset viewer.