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
This commit is contained in:
Scott Taylor
2014-05-06 16:54:10 +00:00
parent e518d0d652
commit ffa620b972

View File

@@ -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 = '<li id="error">'. $post_type['args']->labels->not_found .'</li>';
$db_fields = false;
if ( is_post_type_hierarchical( $post_type_name ) ) {
$db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );