Always register all widgets, props hakre, fixes #10954

git-svn-id: http://svn.automattic.com/wordpress/trunk@12249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-11-21 03:40:55 +00:00
parent 4cb414fc17
commit fce64c00bc
1 changed files with 10 additions and 6 deletions

View File

@ -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) {