WordPress.org

Make WordPress Core

Ticket #18975: 18975.5.diff

File 18975.5.diff, 599 bytes (added by jdgrimes, 2 years ago)
  • src/wp-admin/widgets.php

     
    182182 
    183183        if ( isset($_GET['addnew']) ) { 
    184184                // Default to the first sidebar 
    185                 $sidebar = array_shift( $keys = array_keys($wp_registered_sidebars) ); 
     185                $keys = array_keys( $wp_registered_sidebars ); 
     186                $sidebar = array_shift( $keys ); 
    186187 
    187188                if ( isset($_GET['base']) && isset($_GET['num']) ) { // multi-widget 
    188189                        // Copy minimal info from an existing instance of this widget to a new instance