Make WordPress Core


Ignore:
Timestamp:
05/12/2009 07:17:30 PM (18 years ago)
Author:
ryan
Message:

Fix widget registration with PHP 4. see #9800

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/widgets.php

    r11308 r11310  
    322322
    323323        function register($widget_class) {
    324                 $this->widgets[$widget_class] = new $widget_class();
     324                $this->widgets[$widget_class] = & new $widget_class();
    325325        }
    326326
    … …  
    331331
    332332        function _register_widgets() {
    333                 foreach ( $this->widgets as $widget )
    334                         $widget->_register();
     333                $keys = array_keys($this->widgets);
     334                foreach ( $keys as $key )
     335                        $this->widgets[$key]->_register();
    335336        }
    336337}
Note: See TracChangeset for help on using the changeset viewer.