From 7b72877a6e129f37e451e6fe40928564319c39e3 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 17 Mar 2010 06:10:47 +0000 Subject: [PATCH] Remove half-baked transient caching of nav-menu source results from [13704]. Todo: reimplement with proper cache invalidation. see #11817 git-svn-id: https://develop.svn.wordpress.org/trunk@13726 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/nav-menu.php | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index c8b2ede188..0b4b0b0b3e 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -23,9 +23,6 @@ function wp_nav_menu_post_type_metaboxes() { continue; $id = $post_type->name; - // delete_transient( "nav_menu_items_{$post_type->name}" ); - // delete_transient( "nav_menu_sub_items_{$post_type->name}" ); - 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 ); } } @@ -47,9 +44,6 @@ function wp_nav_menu_taxonomy_metaboxes() { continue; $id = $tax->name; - // delete_transient( "nav_menu_items_{$tax->name}" ); - // delete_transient( "nav_menu_sub_items_{$tax->name}" ); - add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $tax->singular_label ), 'wp_nav_menu_item_taxonomy_metabox', 'menus', 'side', 'default', $tax ); } } @@ -106,12 +100,8 @@ function wp_nav_menu_create_metabox() { ?> function wp_nav_menu_item_link_metabox() { $args = array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom' ); - // Cache the query for a day. @todo: Make sure to flush transient when links are updated. - $query = get_transient( 'menu_item_query_custom_links' ); - if ( false == $query ) { - $query = new WP_Query( $args ); - set_transient( 'menu_item_query_custom_links', $query, 86400 ); - } + // @todo transient caching of these results with proper invalidation on updating links + $query = new WP_Query( $args ); ?>
  • '. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'
  • '; @@ -229,13 +215,9 @@ function wp_nav_menu_item_taxonomy_metabox( $object, $taxonomy ) { 'hide_empty' => false, 'include_last_update_time' => false, 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'number' => '', 'pad_counts' => false ); - - // Cache the query for a day. @todo: Make sure to flush transient when terms are updated. - $terms = get_transient( "nav_menu_items_{$taxonomy['args']->name}" ); - if ( false == $terms ) { - $terms = get_terms( $taxonomy['args']->name, $args ); - set_transient( "nav_menu_items_{$taxonomy['args']->name}", $terms, 86400 ); - } + + // @todo transient caching of these results with proper invalidation on updating of a tax of this type + $terms = get_terms( $taxonomy['args']->name, $args ); if ( !$terms ) $error = '
  • '. sprintf( __( 'No %s exists' ), $taxonomy['args']->label ) .'
  • ';