WordPress.org

Make WordPress Core

Changeset 32545


Ignore:
Timestamp:
05/22/2015 05:46:47 AM (6 years ago)
Author:
wonderboymusic
Message:

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

See #32444.

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image.php

    r31694 r32545  
    191191
    192192    // Remove the blob of binary data from the array.
    193     if ( isset( $metadata['image']['data'] ) )
    194         unset( $metadata['image']['data'] );
     193    unset( $metadata['image']['data'] );
    195194
    196195    /**
  • trunk/src/wp-admin/includes/media.php

    r32352 r32545  
    356356
    357357    // This should never be set as it would then overwrite an existing attachment.
    358     if ( isset( $attachment['ID'] ) )
    359         unset( $attachment['ID'] );
     358    unset( $attachment['ID'] );
    360359
    361360    // Save the data
     
    420419
    421420    // This should never be set as it would then overwrite an existing attachment.
    422     if ( isset( $attachment['ID'] ) )
    423         unset( $attachment['ID'] );
     421    unset( $attachment['ID'] );
    424422
    425423    // Save the attachment metadata
  • trunk/src/wp-admin/includes/nav-menu.php

    r31973 r32545  
    12811281            $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args );
    12821282
    1283             if ( is_wp_error( $menu_item_db_id ) )
     1283            if ( is_wp_error( $menu_item_db_id ) ) {
    12841284                $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
    1285             elseif ( isset( $menu_items[$menu_item_db_id] ) )
    1286                 unset( $menu_items[$menu_item_db_id] );
     1285            } else {
     1286                unset( $menu_items[ $menu_item_db_id ] );
     1287            }
    12871288        }
    12881289    }
  • trunk/src/wp-includes/class-wp-embed.php

    r32544 r32545  
    110110     */
    111111    public function unregister_handler( $id, $priority = 10 ) {
    112         if ( isset($this->handlers[$priority][$id]) )
    113             unset($this->handlers[$priority][$id]);
     112        unset( $this->handlers[ $priority ][ $id ] );
    114113    }
    115114
  • trunk/src/wp-includes/class-wp-walker.php

    r31141 r32545  
    409409                $this->unset_children( $child, $children_elements );
    410410
    411         if ( isset($children_elements[$id]) )
    412             unset( $children_elements[$id] );
    413 
     411        unset( $children_elements[ $id ] );
    414412    }
    415413
  • trunk/src/wp-includes/general-template.php

    r32359 r32545  
    26692669        // Remove the format argument from the array of query arguments, to avoid overwriting custom format.
    26702670        foreach ( $format_args as $format_arg => $format_arg_value ) {
    2671             if ( isset( $url_query_args[ $format_arg ] ) ) {
    2672                 unset( $url_query_args[ $format_arg ] );
    2673             }
     2671            unset( $url_query_args[ $format_arg ] );
    26742672        }
    26752673
  • trunk/src/wp-includes/plugin.php

    r32116 r32545  
    333333    }
    334334
    335     if ( isset( $merged_filters[ $tag ] ) ) {
    336         unset( $merged_filters[ $tag ] );
    337     }
     335    unset( $merged_filters[ $tag ] );
    338336
    339337    return true;
  • trunk/src/wp-includes/post.php

    r32524 r32545  
    17561756    global $_wp_post_type_features;
    17571757
    1758     if ( isset( $_wp_post_type_features[$post_type][$feature] ) )
    1759         unset( $_wp_post_type_features[$post_type][$feature] );
     1758    unset( $_wp_post_type_features[ $post_type ][ $feature ] );
    17601759}
    17611760
  • trunk/src/wp-includes/widgets.php

    r32116 r32545  
    570570     */
    571571    public function unregister( $widget_class ) {
    572         if ( isset($this->widgets[$widget_class]) )
    573             unset($this->widgets[$widget_class]);
     572        unset( $this->widgets[ $widget_class ] );
    574573    }
    575574
     
    852851    global $wp_registered_sidebars;
    853852
    854     if ( isset( $wp_registered_sidebars[$name] ) )
    855         unset( $wp_registered_sidebars[$name] );
     853    unset( $wp_registered_sidebars[ $name ] );
    856854}
    857855
     
    894892    $id_base = _get_widget_id_base($id);
    895893    if ( in_array($output_callback, $_wp_deprecated_widgets_callbacks, true) && !is_callable($output_callback) ) {
    896         if ( isset($wp_registered_widget_controls[$id]) )
    897             unset($wp_registered_widget_controls[$id]);
    898 
    899         if ( isset($wp_registered_widget_updates[$id_base]) )
    900             unset($wp_registered_widget_updates[$id_base]);
    901 
     894        unset( $wp_registered_widget_controls[ $id ] );
     895        unset( $wp_registered_widget_updates[ $id_base ] );
    902896        return;
    903897    }
     
    10251019
    10261020    if ( in_array($control_callback, $_wp_deprecated_widgets_callbacks, true) && !is_callable($control_callback) ) {
    1027         if ( isset($wp_registered_widgets[$id]) )
    1028             unset($wp_registered_widgets[$id]);
    1029 
     1021        unset( $wp_registered_widgets[ $id ] );
    10301022        return;
    10311023    }
Note: See TracChangeset for help on using the changeset viewer.