When calling `unset()`, it is unnecessary to immediately precede it with a call to `isset()`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-05-22 05:47:25 +00:00
parent 1fa7958fe8
commit af7a017f46
10 changed files with 18 additions and 36 deletions

View File

@ -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.

View File

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

View File

@ -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 ] );
}
}
}

View File

@ -109,8 +109,7 @@ class WP_Embed {
* @param int $priority Optional. The priority of the handler to be removed (default: 10).
*/
public function unregister_handler( $id, $priority = 10 ) {
if ( isset($this->handlers[$priority][$id]) )
unset($this->handlers[$priority][$id]);
unset( $this->handlers[ $priority ][ $id ] );
}
/**

View File

@ -408,9 +408,7 @@ class Walker {
foreach ( (array) $children_elements[$id] as $child )
$this->unset_children( $child, $children_elements );
if ( isset($children_elements[$id]) )
unset( $children_elements[$id] );
unset( $children_elements[ $id ] );
}
} // Walker

View File

@ -2668,9 +2668,7 @@ function paginate_links( $args = '' ) {
// Remove the format argument from the array of query arguments, to avoid overwriting custom format.
foreach ( $format_args as $format_arg => $format_arg_value ) {
if ( isset( $url_query_args[ $format_arg ] ) ) {
unset( $url_query_args[ $format_arg ] );
}
unset( $url_query_args[ $format_arg ] );
}
$args['add_args'] = array_merge( $args['add_args'], urlencode_deep( $url_query_args ) );

View File

@ -332,9 +332,7 @@ function remove_all_filters( $tag, $priority = false ) {
}
}
if ( isset( $merged_filters[ $tag ] ) ) {
unset( $merged_filters[ $tag ] );
}
unset( $merged_filters[ $tag ] );
return true;
}

View File

@ -1755,8 +1755,7 @@ function add_post_type_support( $post_type, $feature ) {
function remove_post_type_support( $post_type, $feature ) {
global $_wp_post_type_features;
if ( isset( $_wp_post_type_features[$post_type][$feature] ) )
unset( $_wp_post_type_features[$post_type][$feature] );
unset( $_wp_post_type_features[ $post_type ][ $feature ] );
}
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32544';
$wp_version = '4.3-alpha-32545';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -569,8 +569,7 @@ class WP_Widget_Factory {
* @param string $widget_class The name of a {@see WP_Widget} subclass.
*/
public function unregister( $widget_class ) {
if ( isset($this->widgets[$widget_class]) )
unset($this->widgets[$widget_class]);
unset( $this->widgets[ $widget_class ] );
}
/**
@ -851,8 +850,7 @@ function register_sidebar($args = array()) {
function unregister_sidebar( $name ) {
global $wp_registered_sidebars;
if ( isset( $wp_registered_sidebars[$name] ) )
unset( $wp_registered_sidebars[$name] );
unset( $wp_registered_sidebars[ $name ] );
}
/**
@ -893,12 +891,8 @@ function wp_register_sidebar_widget( $id, $name, $output_callback, $options = ar
$id_base = _get_widget_id_base($id);
if ( in_array($output_callback, $_wp_deprecated_widgets_callbacks, true) && !is_callable($output_callback) ) {
if ( isset($wp_registered_widget_controls[$id]) )
unset($wp_registered_widget_controls[$id]);
if ( isset($wp_registered_widget_updates[$id_base]) )
unset($wp_registered_widget_updates[$id_base]);
unset( $wp_registered_widget_controls[ $id ] );
unset( $wp_registered_widget_updates[ $id_base ] );
return;
}
@ -1024,9 +1018,7 @@ function wp_register_widget_control( $id, $name, $control_callback, $options = a
}
if ( in_array($control_callback, $_wp_deprecated_widgets_callbacks, true) && !is_callable($control_callback) ) {
if ( isset($wp_registered_widgets[$id]) )
unset($wp_registered_widgets[$id]);
unset( $wp_registered_widgets[ $id ] );
return;
}