mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
When calling unset(), it is unnecessary to immediately precede it with a call to isset().
See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32545 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -190,8 +190,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
||||
}
|
||||
|
||||
// Remove the blob of binary data from the array.
|
||||
if ( isset( $metadata['image']['data'] ) )
|
||||
unset( $metadata['image']['data'] );
|
||||
unset( $metadata['image']['data'] );
|
||||
|
||||
/**
|
||||
* Filter the generated attachment meta data.
|
||||
|
||||
@@ -355,8 +355,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
|
||||
), $post_data );
|
||||
|
||||
// This should never be set as it would then overwrite an existing attachment.
|
||||
if ( isset( $attachment['ID'] ) )
|
||||
unset( $attachment['ID'] );
|
||||
unset( $attachment['ID'] );
|
||||
|
||||
// Save the data
|
||||
$id = wp_insert_attachment($attachment, $file, $post_id);
|
||||
@@ -419,8 +418,7 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
|
||||
), $post_data );
|
||||
|
||||
// This should never be set as it would then overwrite an existing attachment.
|
||||
if ( isset( $attachment['ID'] ) )
|
||||
unset( $attachment['ID'] );
|
||||
unset( $attachment['ID'] );
|
||||
|
||||
// Save the attachment metadata
|
||||
$id = wp_insert_attachment($attachment, $file, $post_id);
|
||||
|
||||
@@ -1280,10 +1280,11 @@ function wp_nav_menu_update_menu_items ( $nav_menu_selected_id, $nav_menu_select
|
||||
|
||||
$menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args );
|
||||
|
||||
if ( is_wp_error( $menu_item_db_id ) )
|
||||
if ( is_wp_error( $menu_item_db_id ) ) {
|
||||
$messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
|
||||
elseif ( isset( $menu_items[$menu_item_db_id] ) )
|
||||
unset( $menu_items[$menu_item_db_id] );
|
||||
} else {
|
||||
unset( $menu_items[ $menu_item_db_id ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user