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.


Built from https://develop.svn.wordpress.org/trunk@28300


git-svn-id: http://core.svn.wordpress.org/trunk@28128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-06 16:55:14 +00:00
parent 85bdc64173
commit e57fa7300d

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' );