WordPress.org

Make WordPress Core

Ticket #4169: move-stuff-around.diff

File move-stuff-around.diff, 4.5 KB (added by rob1n, 11 years ago)
  • wp-includes/default-filters.php

     
    173173add_action('admin_print_scripts', 'wp_print_scripts', 20); 
    174174add_action('mce_options', '_mce_set_direction'); 
    175175add_action('init', 'smilies_init', 5); 
    176 add_action('init', 'wp_widgets_init', 1); 
    177 ?> 
     176 
     177add_action( 'plugins_loaded', 'wp_load_widgets', 0 ); 
     178 
     179?> 
     180 No newline at end of file 
  • wp-includes/widgets.php

     
    11<?php 
    22 
     3/* 
     4        Check if another widget plugin is active. If this is so,  
     5        then bail out. 
     6*/ 
     7 
     8if ( function_exists( 'dynamic_sidebars' ) ) { 
     9        return; 
     10} 
     11 
    312/* Global Variables */ 
    413 
     14global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_styles, $wp_registered_widget_defaults; 
     15 
    516$wp_registered_sidebars = array(); 
    617$wp_registered_widgets = array(); 
    718$wp_registered_widget_controls = array(); 
     
    1021 
    1122/* Template tags & API functions */ 
    1223 
    13 if ( !function_exists( 'register_sidebars' ) ): 
    1424function register_sidebars($number = 1, $args = array()) { 
    1525        $number = (int) $number; 
    1626 
     
    3141                ++$i; 
    3242        } 
    3343} 
    34 endif; 
    3544 
    36 if ( !function_exists( 'register_sidebar' ) ): 
    3745function register_sidebar($args = array()) { 
    3846        global $wp_registered_sidebars; 
    3947 
     
    5765 
    5866        return $sidebar['id']; 
    5967} 
    60 endif; 
    6168 
    62 if ( !function_exists( 'unregister_sidebar' ) ): 
    6369function unregister_sidebar( $name ) { 
    6470        global $wp_registered_sidebars; 
    6571                 
    6672        if ( isset( $wp_registered_sidebars[$name] ) ) 
    6773                unset( $wp_registered_sidebars[$name] ); 
    6874} 
    69 endif; 
    7075 
    71 if ( !function_exists( 'register_sidebar_widget' ) ): 
    7276function register_sidebar_widget($name, $output_callback, $classname = '', $id = '') { 
    7377        global $wp_registered_widgets, $wp_register_widget_defaults; 
    7478 
     
    100104        elseif ( is_callable($output_callback) && ( !isset($wp_registered_widgets[$id]) || !$wp_register_widget_defaults) ) 
    101105                $wp_registered_widgets[$id] = $widget; 
    102106} 
    103 endif; 
    104107 
    105 if ( !function_exists( 'unregister_sidebar_widget' ) ): 
    106108function unregister_sidebar_widget($id) { 
    107109        $id = sanitize_title($id); 
    108110        register_sidebar_widget('', '', '', $id); 
    109111        unregister_widget_control($id); 
    110112} 
    111 endif; 
    112113 
    113 if ( !function_exists( 'register_widget_control' ) ): 
    114114function register_widget_control($name, $control_callback, $width = 300, $height = 200, $id = '') { 
    115115        global $wp_registered_widget_controls, $wp_register_widget_defaults; 
    116116 
     
    142142                        'params' => array_slice(func_get_args(), 5) 
    143143                ); 
    144144} 
    145 endif; 
    146145 
    147 if ( !function_exists( 'unregister_widget_control' ) ): 
    148146function unregister_widget_control($id) { 
    149147        $id = sanitize_title($id); 
    150148        return register_widget_control($id, ''); 
    151149} 
    152 endif; 
    153150 
    154 if ( !function_exists( 'dynamic_sidebar' ) ): 
    155151function dynamic_sidebar($index = 1) { 
    156152        global $wp_registered_sidebars, $wp_registered_widgets; 
    157153 
     
    185181 
    186182        return $did_one; 
    187183} 
    188 endif; 
    189184 
    190 if ( !function_exists( 'is_active_widget' ) ): 
    191185function is_active_widget($callback) { 
    192186        global $wp_registered_widgets; 
    193187 
     
    200194 
    201195        return false; 
    202196} 
    203 endif; 
    204197 
    205 if ( !function_exists( 'is_dynamic_sidebar' ) ): 
    206198function is_dynamic_sidebar() { 
    207199        global $wp_registered_widgets, $wp_registered_sidebars; 
    208200        $sidebars_widgets = get_option('sidebars_widgets'); 
     
    215207        } 
    216208        return false; 
    217209} 
    218 endif; 
    219210 
    220211/* Internal Functions */ 
    221212 
     
    909900        do_action('widgets_init'); 
    910901} 
    911902 
    912 ?> 
     903add_action('init', 'wp_widgets_init', 1); 
     904 
     905?> 
     906 No newline at end of file 
  • wp-includes/functions.php

     
    15021502        endif; 
    15031503} 
    15041504 
    1505 ?> 
     1505function wp_load_widgets() { 
     1506        require_once ABSPATH . WPINC . '/widgets.php'; 
     1507} 
     1508 
     1509?> 
     1510 No newline at end of file 
  • wp-settings.php

     
    168168require (ABSPATH . WPINC . '/version.php'); 
    169169require (ABSPATH . WPINC . '/deprecated.php'); 
    170170require (ABSPATH . WPINC . '/script-loader.php'); 
    171 require (ABSPATH . WPINC . '/widgets.php'); 
    172171 
    173172if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) { 
    174173    // Used to guarantee unique hash cookies