From fce64c00bca104e347daa6d0a28452f703bd110c Mon Sep 17 00:00:00 2001 From: azaozz Date: Sat, 21 Nov 2009 03:40:55 +0000 Subject: [PATCH] Always register all widgets, props hakre, fixes #10954 git-svn-id: http://svn.automattic.com/wordpress/trunk@12249 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 2731fd2a5..47c0e6fcf 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) {