Explicitly globalize some variables, so that unit tests can run WordPress inside a function. Fixes #17749

git-svn-id: http://svn.automattic.com/wordpress/trunk@18532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nbachiyski 2011-08-11 04:45:14 +00:00
parent 4870176ad0
commit abe8b47351
3 changed files with 4 additions and 3 deletions

View File

@ -1288,7 +1288,7 @@ class WP_Embed {
return apply_filters( 'embed_maybe_make_link', $output, $url );
}
}
$wp_embed = new WP_Embed();
$GLOBALS['wp_embed'] = new WP_Embed();
/**
* Register an embed handler. This function should probably only be used for sites that do not support oEmbed.

View File

@ -385,7 +385,7 @@ $_wp_sidebars_widgets = array();
/**
* Private
*/
$_wp_deprecated_widgets_callbacks = array(
$GLOBALS['_wp_deprecated_widgets_callbacks'] = array(
'wp_widget_pages',
'wp_widget_pages_control',
'wp_widget_calendar',

View File

@ -104,6 +104,7 @@ require( ABSPATH . WPINC . '/l10n.php' );
// Run the installer if WordPress is not installed.
wp_not_installed();
// Load most of WordPress.
require( ABSPATH . WPINC . '/class-wp-walker.php' );
require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
@ -249,7 +250,7 @@ $wp = new WP();
* @global object $wp_widget_factory
* @since 2.8.0
*/
$wp_widget_factory = new WP_Widget_Factory();
$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
do_action( 'setup_theme' );