Make WordPress Core


Ignore:
Timestamp:
03/17/2010 06:10:47 AM (17 years ago)
Author:
markjaquith
Message:

Remove half-baked transient caching of nav-menu source results from [13704]. Todo: reimplement with proper cache invalidation. see #11817

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/nav-menu.php

    r13725 r13726  
    2424                $id = $post_type->name;
    2525
    26                 // delete_transient( "nav_menu_items_{$post_type->name}" );
    27                 // delete_transient( "nav_menu_sub_items_{$post_type->name}" );
    28                
    2926                add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $post_type->singular_label ), 'wp_nav_menu_item_post_type_metabox', 'menus', 'side', 'default', $post_type );
    3027        }
    … …  
    4744                        continue;
    4845                $id = $tax->name;
    49 
    50                 // delete_transient( "nav_menu_items_{$tax->name}" );
    51                 // delete_transient( "nav_menu_sub_items_{$tax->name}" );
    5246
    5347                add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $tax->singular_label ), 'wp_nav_menu_item_taxonomy_metabox', 'menus', 'side', 'default', $tax );
    … …  
    107101        $args = array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom' );     
    108102       
    109         // Cache the query for a day. @todo: Make sure to flush transient when links are updated.
    110         $query = get_transient( 'menu_item_query_custom_links' );
    111         if ( false == $query ) {
    112                 $query = new WP_Query( $args );
    113                 set_transient( 'menu_item_query_custom_links', $query, 86400 );
    114         }
     103        // @todo transient caching of these results with proper invalidation on updating links
     104        $query = new WP_Query( $args );
    115105       
    116106        ?>
    … …  
    161151                $args['post_status'] = 'any';
    162152       
    163         // Cache the query for a day. @todo: Make sure to flush transient when objects are updated.
    164         $query = get_transient( "nav_menu_items_{$post_type['args']->name}" );
    165         if ( false == $query ) {
    166                 $query = new WP_Query( $args );
    167                 set_transient( "nav_menu_items_{$post_type['args']->name}", $query, 86400 );
    168         }
     153        // @todo transient caching of these results with proper invalidation on updating of a post of this type
     154        $query = new WP_Query( $args );
    169155       
    170156        if ( !$query->posts )
    … …  
    230216                'include' => '', 'number' => '', 'pad_counts' => false
    231217        );
    232        
    233         // Cache the query for a day. @todo: Make sure to flush transient when terms are updated.
    234         $terms = get_transient( "nav_menu_items_{$taxonomy['args']->name}" );
    235         if ( false == $terms ) {
    236                 $terms = get_terms( $taxonomy['args']->name, $args );
    237                 set_transient( "nav_menu_items_{$taxonomy['args']->name}", $terms, 86400 );
    238         }
     218
     219        // @todo transient caching of these results with proper invalidation on updating of a tax of this type
     220        $terms = get_terms( $taxonomy['args']->name, $args );
    239221       
    240222        if ( !$terms )
Note: See TracChangeset for help on using the changeset viewer.