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:
parent
12be75ed58
commit
2a8091e386
|
@ -321,7 +321,7 @@ class WP_Widget_Factory {
|
|||
}
|
||||
|
||||
function register($widget_class) {
|
||||
$this->widgets[$widget_class] = new $widget_class();
|
||||
$this->widgets[$widget_class] = & new $widget_class();
|
||||
}
|
||||
|
||||
function unregister($widget_class) {
|
||||
|
@ -330,8 +330,9 @@ class WP_Widget_Factory {
|
|||
}
|
||||
|
||||
function _register_widgets() {
|
||||
foreach ( $this->widgets as $widget )
|
||||
$widget->_register();
|
||||
$keys = array_keys($this->widgets);
|
||||
foreach ( $keys as $key )
|
||||
$this->widgets[$key]->_register();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue