From 67bd2acaf9f3be957f3b0044f46257ceca87c529 Mon Sep 17 00:00:00 2001 From: rob1n Date: Tue, 1 May 2007 01:13:06 +0000 Subject: [PATCH] Move widget stuff around. see #4169 git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@5360 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/default-filters.php | 6 ++++-- wp-includes/functions.php | 6 +++++- wp-includes/widgets.php | 35 +++++++++++++-------------------- wp-settings.php | 1 - 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 730a07f6c5..2cbbef38dd 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -173,5 +173,7 @@ add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); add_action('admin_print_scripts', 'wp_print_scripts', 20); add_action('mce_options', '_mce_set_direction'); add_action('init', 'smilies_init', 5); -add_action('init', 'wp_widgets_init', 1); -?> + +add_action( 'plugins_loaded', 'wp_load_widgets', 0 ); + +?> \ No newline at end of file diff --git a/wp-includes/functions.php b/wp-includes/functions.php index cf0d94c437..5b4dd1c415 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1468,4 +1468,8 @@ function smilies_init() { } } -?> +function wp_load_widgets() { + require_once ABSPATH . WPINC . '/widgets.php'; +} + +?> \ No newline at end of file diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 69feb0e8a8..01bd6866b3 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1,7 +1,18 @@ array_slice(func_get_args(), 5) ); } -endif; -if ( !function_exists( 'unregister_widget_control' ) ): function unregister_widget_control($id) { $id = sanitize_title($id); return register_widget_control($id, ''); } -endif; -if ( !function_exists( 'dynamic_sidebar' ) ): function dynamic_sidebar($index = 1) { global $wp_registered_sidebars, $wp_registered_widgets; @@ -185,9 +181,7 @@ function dynamic_sidebar($index = 1) { return $did_one; } -endif; -if ( !function_exists( 'is_active_widget' ) ): function is_active_widget($callback) { global $wp_registered_widgets; @@ -200,9 +194,7 @@ function is_active_widget($callback) { return false; } -endif; -if ( !function_exists( 'is_dynamic_sidebar' ) ): function is_dynamic_sidebar() { global $wp_registered_widgets, $wp_registered_sidebars; $sidebars_widgets = get_option('sidebars_widgets'); @@ -215,7 +207,6 @@ function is_dynamic_sidebar() { } return false; } -endif; /* Internal Functions */ @@ -909,4 +900,6 @@ function wp_widgets_init() { do_action('widgets_init'); } -?> +add_action('init', 'wp_widgets_init', 1); + +?> \ No newline at end of file diff --git a/wp-settings.php b/wp-settings.php index f427ee5c41..2221649be3 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -168,7 +168,6 @@ require (ABSPATH . WPINC . '/cron.php'); require (ABSPATH . WPINC . '/version.php'); require (ABSPATH . WPINC . '/deprecated.php'); require (ABSPATH . WPINC . '/script-loader.php'); -require (ABSPATH . WPINC . '/widgets.php'); if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) { // Used to guarantee unique hash cookies