From 0cf5f8cf129cf00020a85d17ba0d4ee03e0c0c48 Mon Sep 17 00:00:00 2001 From: rob1n Date: Tue, 1 May 2007 01:58:18 +0000 Subject: [PATCH] New way of loading widgets that works with PHP 5. Thanks to filosofo for testing. see #4169 git-svn-id: https://develop.svn.wordpress.org/trunk@5363 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/default-filters.php | 2 +- wp-includes/functions.php | 6 ++++-- wp-includes/widgets.php | 9 --------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 2cbbef38dd..eb0064e456 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -174,6 +174,6 @@ add_action('admin_print_scripts', 'wp_print_scripts', 20); add_action('mce_options', '_mce_set_direction'); add_action('init', 'smilies_init', 5); -add_action( 'plugins_loaded', 'wp_load_widgets', 0 ); +add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); ?> \ No newline at end of file diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2f28878138..55d128cdcd 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1502,8 +1502,10 @@ function wp_parse_args( $args, $defaults = '' ) { endif; } -function wp_load_widgets() { - require_once ABSPATH . WPINC . '/widgets.php'; +function wp_maybe_load_widgets() { + if ( !function_exists( 'dynamic_sidebar' ) ) { + 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 447bfd41d8..e177af3458 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1,14 +1,5 @@