X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/98a4d31e52bd56c908617df281730bd4ba58d110..312084b5d95c21feb519ff03decf948420e1f6fa:/wp-includes/widgets.php?ds=sidebyside diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 2f0280d7..47c0e6fc 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -126,20 +126,24 @@ class WP_Widget { function _register() { $settings = $this->get_settings(); + $empty = true; - if ( empty($settings) ) { - // If there are none, we register the widget's existance with a - // generic template - $this->_set(1); - $this->_register_one(); - } elseif ( is_array($settings) ) { + if ( is_array($settings) ) { foreach ( array_keys($settings) as $number ) { if ( is_numeric($number) ) { $this->_set($number); $this->_register_one($number); + $empty = false; } } } + + if ( $empty ) { + // If there are none, we register the widget's existance with a + // generic template + $this->_set(1); + $this->_register_one(); + } } function _set($number) { @@ -544,6 +548,7 @@ function register_sidebar($args = array()) { $defaults = array( 'name' => sprintf(__('Sidebar %d'), $i ), 'id' => "sidebar-$i", + 'description' => '', 'before_widget' => '