Changeset 13726
- Timestamp:
- 03/17/2010 06:10:47 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/nav-menu.php
r13725 r13726 24 24 $id = $post_type->name; 25 25 26 // delete_transient( "nav_menu_items_{$post_type->name}" );27 // delete_transient( "nav_menu_sub_items_{$post_type->name}" );28 29 26 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 ); 30 27 } … … 47 44 continue; 48 45 $id = $tax->name; 49 50 // delete_transient( "nav_menu_items_{$tax->name}" );51 // delete_transient( "nav_menu_sub_items_{$tax->name}" );52 46 53 47 add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $tax->singular_label ), 'wp_nav_menu_item_taxonomy_metabox', 'menus', 'side', 'default', $tax ); … … 107 101 $args = array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom' ); 108 102 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 ); 115 105 116 106 ?> … … 161 151 $args['post_status'] = 'any'; 162 152 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 ); 169 155 170 156 if ( !$query->posts ) … … 230 216 'include' => '', 'number' => '', 'pad_counts' => false 231 217 ); 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 ); 239 221 240 222 if ( !$terms )
Note: See TracChangeset
for help on using the changeset viewer.