From 782b99b45121e1f2f5ffcdfd3c01a99f772fab78 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 19 Mar 2009 22:10:18 +0000 Subject: [PATCH] Move WP_Widget to the top git-svn-id: http://svn.automattic.com/wordpress/trunk@10822 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 108 ++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 084360b59..f31ca7383 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -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 */ /**