Make WordPress Core

Changeset 10822


Ignore:
Timestamp:
03/19/2009 10:10:18 PM (17 years ago)
Author:
ryan
Message:

Move WP_Widget to the top

File:
1 edited

Legend:

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

    r10812 r10822  
    1313 * @subpackage Widgets
    1414 */
    15 
    16 /* Global Variables */
    17 
    18 /** @ignore */
    19 global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;
    20 
    21 /**
    22  * Stores the sidebars, since many themes can have more than one.
    23  *
    24  * @global array $wp_registered_sidebars
    25  * @since 2.2.0
    26  */
    27 $wp_registered_sidebars = array();
    28 
    29 /**
    30  * Stores the registered widgets.
    31  *
    32  * @global array $wp_registered_widgets
    33  * @since 2.2.0
    34  */
    35 $wp_registered_widgets = array();
    36 
    37 /**
    38  * Stores the registered widget control (options).
    39  *
    40  * @global array $wp_registered_widget_controls
    41  * @since 2.2.0
    42  */
    43 $wp_registered_widget_controls = array();
    44 $wp_registered_widget_updates = array();
    45 
    46 /**
    47  * Singleton that registers and instantiates WP_Widget classes.
    48  *
    49  * @package WordPress
    50  * @subpackage Widgets
    51  * @since 2.8
    52  */
    53 class WP_Widget_Factory {
    54     var $widgets = array();
    55 
    56     function WP_Widget_Factory() {
    57         add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 );
    58     }
    59 
    60     function register($widget_class) {
    61         $this->widgets[] = new $widget_class();
    62     }
    63 
    64     function _register_widgets() {
    65         foreach ( $this->widgets as $widget )
    66             $widget->_register();
    67     }
    68 }
    6915
    7016/**
     
    333279}
    334280
     281/**
     282 * Singleton that registers and instantiates WP_Widget classes.
     283 *
     284 * @package WordPress
     285 * @subpackage Widgets
     286 * @since 2.8
     287 */
     288class WP_Widget_Factory {
     289    var $widgets = array();
     290
     291    function WP_Widget_Factory() {
     292        add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 );
     293    }
     294
     295    function register($widget_class) {
     296        $this->widgets[] = new $widget_class();
     297    }
     298
     299    function _register_widgets() {
     300        foreach ( $this->widgets as $widget )
     301            $widget->_register();
     302    }
     303}
     304
     305/* Global Variables */
     306
     307/** @ignore */
     308global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;
     309
     310/**
     311 * Stores the sidebars, since many themes can have more than one.
     312 *
     313 * @global array $wp_registered_sidebars
     314 * @since 2.2.0
     315 */
     316$wp_registered_sidebars = array();
     317
     318/**
     319 * Stores the registered widgets.
     320 *
     321 * @global array $wp_registered_widgets
     322 * @since 2.2.0
     323 */
     324$wp_registered_widgets = array();
     325
     326/**
     327 * Stores the registered widget control (options).
     328 *
     329 * @global array $wp_registered_widget_controls
     330 * @since 2.2.0
     331 */
     332$wp_registered_widget_controls = array();
     333$wp_registered_widget_updates = array();
     334
    335335/* Template tags & API functions */
    336336
Note: See TracChangeset for help on using the changeset viewer.