Make WordPress Core


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

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

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.