From ffa620b972cd4431d51bd5087232549178a86610 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 6 May 2014 16:54:10 +0000 Subject: [PATCH] In `wp-admin/includes/nav-menu.php`, remove dead code: * In `_wp_ajax_menu_quick_search()`, in an `else` block, `$post_obj` was set and not used. Another block sets it again and does use it. * In `wp_nav_menu_item_post_type_meta_box()`, `$post_type_object` was set and, sadly, never used. `$error` was set and not used. See #27882. git-svn-id: https://develop.svn.wordpress.org/trunk@28300 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/nav-menu.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php index 1dfccf058d..b6430da419 100644 --- a/src/wp-admin/includes/nav-menu.php +++ b/src/wp-admin/includes/nav-menu.php @@ -356,7 +356,6 @@ function _wp_ajax_menu_quick_search( $request = array() ) { if ( 'markup' == $response_format ) { echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $object_id ) ) ), 0, (object) $args ); } elseif ( 'json' == $response_format ) { - $post_obj = get_post( $object_id ); echo json_encode( array( 'ID' => $object_id, @@ -643,8 +642,6 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { return; } - $post_type_object = get_post_type_object($post_type_name); - $num_pages = $get_posts->max_num_pages; $page_links = paginate_links( array( @@ -663,9 +660,6 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { 'current' => $pagenum )); - if ( !$posts ) - $error = '
  • '. $post_type['args']->labels->not_found .'
  • '; - $db_fields = false; if ( is_post_type_hierarchical( $post_type_name ) ) { $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );