From 2a8091e3865761a8b157b2692cd6edbca6bedd09 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 12 May 2009 19:17:30 +0000 Subject: [PATCH] Fix widget registration with PHP 4. see #9800 git-svn-id: http://svn.automattic.com/wordpress/trunk@11310 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 60e2887db3..d2875a003f 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -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(); } }