New way of loading widgets that works with PHP 5. Thanks to filosofo for testing. see #4169
git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@5363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
67bd2acaf9
commit
276c2f7b94
|
@ -174,6 +174,6 @@ add_action('admin_print_scripts', 'wp_print_scripts', 20);
|
||||||
add_action('mce_options', '_mce_set_direction');
|
add_action('mce_options', '_mce_set_direction');
|
||||||
add_action('init', 'smilies_init', 5);
|
add_action('init', 'smilies_init', 5);
|
||||||
|
|
||||||
add_action( 'plugins_loaded', 'wp_load_widgets', 0 );
|
add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -1468,8 +1468,10 @@ function smilies_init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_load_widgets() {
|
function wp_maybe_load_widgets() {
|
||||||
require_once ABSPATH . WPINC . '/widgets.php';
|
if ( !function_exists( 'dynamic_sidebar' ) ) {
|
||||||
|
require_once ABSPATH . WPINC . '/widgets.php';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -1,14 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
|
||||||
Check if another widget plugin is active. If this is so,
|
|
||||||
then bail out.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ( function_exists( 'dynamic_sidebars' ) ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Global Variables */
|
/* Global Variables */
|
||||||
|
|
||||||
global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_styles, $wp_registered_widget_defaults;
|
global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_styles, $wp_registered_widget_defaults;
|
||||||
|
|
Loading…
Reference in New Issue