### Eclipse Workspace Patch 1.0 #P wordpress-trunk Index: wp-includes/widgets.php =================================================================== --- wp-includes/widgets.php (revision 12132) +++ wp-includes/widgets.php (working copy) @@ -133,11 +133,23 @@ $this->_set(1); $this->_register_one(); } elseif ( is_array($settings) ) { + // If there is an array, first assume it contains a numerically + // indexed set of options but that's just an assumption + $count = 0; foreach ( array_keys($settings) as $number ) { if ( is_numeric($number) ) { + $count++; $this->_set($number); $this->_register_one($number); } + } + // fallback in case the assumption what the array was for + // was wrong + if ($count == 0) { + // If there are none, we register the widget's existance with a + // generic template (see if ( empty($settings) ) ) + $this->_set(1); + $this->_register_one(); } } }