From 9b39471cc01876b4d66e0827bb7ab2a5e198fdc6 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 19 Mar 2009 22:10:18 +0000 Subject: [PATCH] Move WP_Widget to the top git-svn-id: https://develop.svn.wordpress.org/trunk@10822 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 084360b597..f31ca7383e 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 */ /**