Fix widget registration with PHP 4. see #9800

git-svn-id: http://svn.automattic.com/wordpress/trunk@11310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-05-12 19:17:30 +00:00
parent 12be75ed58
commit 2a8091e386
1 changed files with 4 additions and 3 deletions

View File

@ -321,7 +321,7 @@ class WP_Widget_Factory {
} }
function register($widget_class) { function register($widget_class) {
$this->widgets[$widget_class] = new $widget_class(); $this->widgets[$widget_class] = & new $widget_class();
} }
function unregister($widget_class) { function unregister($widget_class) {
@ -330,8 +330,9 @@ class WP_Widget_Factory {
} }
function _register_widgets() { function _register_widgets() {
foreach ( $this->widgets as $widget ) $keys = array_keys($this->widgets);
$widget->_register(); foreach ( $keys as $key )
$this->widgets[$key]->_register();
} }
} }