Move WP_Widget to the top

git-svn-id: http://svn.automattic.com/wordpress/trunk@10822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-03-19 22:10:18 +00:00
parent 427e5aa3e5
commit 782b99b451
1 changed files with 54 additions and 54 deletions

View File

@ -13,60 +13,6 @@
* @subpackage Widgets
*/
/* Global Variables */
/** @ignore */
global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;
/**
* Stores the sidebars, since many themes can have more than one.
*
* @global array $wp_registered_sidebars
* @since 2.2.0
*/
$wp_registered_sidebars = array();
/**
* Stores the registered widgets.
*
* @global array $wp_registered_widgets
* @since 2.2.0
*/
$wp_registered_widgets = array();
/**
* Stores the registered widget control (options).
*
* @global array $wp_registered_widget_controls
* @since 2.2.0
*/
$wp_registered_widget_controls = array();
$wp_registered_widget_updates = array();
/**
* Singleton that registers and instantiates WP_Widget classes.
*
* @package WordPress
* @subpackage Widgets
* @since 2.8
*/
class WP_Widget_Factory {
var $widgets = array();
function WP_Widget_Factory() {
add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 );
}
function register($widget_class) {
$this->widgets[] = new $widget_class();
}
function _register_widgets() {
foreach ( $this->widgets as $widget )
$widget->_register();
}
}
/**
* This class must be extended for each widget and WP_Widget::widget(), WP_Widget::update()
* and WP_Widget::form() need to be over-ridden.
@ -332,6 +278,60 @@ class WP_Widget {
}
}
/**
* Singleton that registers and instantiates WP_Widget classes.
*
* @package WordPress
* @subpackage Widgets
* @since 2.8
*/
class WP_Widget_Factory {
var $widgets = array();
function WP_Widget_Factory() {
add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 );
}
function register($widget_class) {
$this->widgets[] = new $widget_class();
}
function _register_widgets() {
foreach ( $this->widgets as $widget )
$widget->_register();
}
}
/* Global Variables */
/** @ignore */
global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;
/**
* Stores the sidebars, since many themes can have more than one.
*
* @global array $wp_registered_sidebars
* @since 2.2.0
*/
$wp_registered_sidebars = array();
/**
* Stores the registered widgets.
*
* @global array $wp_registered_widgets
* @since 2.2.0
*/
$wp_registered_widgets = array();
/**
* Stores the registered widget control (options).
*
* @global array $wp_registered_widget_controls
* @since 2.2.0
*/
$wp_registered_widget_controls = array();
$wp_registered_widget_updates = array();
/* Template tags & API functions */
/**