Explicitly globalize some variables, so that unit tests can run WordPress inside a function. Fixes #17749
git-svn-id: https://develop.svn.wordpress.org/trunk@18532 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c5b4e06e15
commit
13181c96c8
@ -1288,7 +1288,7 @@ class WP_Embed {
|
|||||||
return apply_filters( 'embed_maybe_make_link', $output, $url );
|
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.
|
* Register an embed handler. This function should probably only be used for sites that do not support oEmbed.
|
||||||
|
@ -385,7 +385,7 @@ $_wp_sidebars_widgets = array();
|
|||||||
/**
|
/**
|
||||||
* Private
|
* Private
|
||||||
*/
|
*/
|
||||||
$_wp_deprecated_widgets_callbacks = array(
|
$GLOBALS['_wp_deprecated_widgets_callbacks'] = array(
|
||||||
'wp_widget_pages',
|
'wp_widget_pages',
|
||||||
'wp_widget_pages_control',
|
'wp_widget_pages_control',
|
||||||
'wp_widget_calendar',
|
'wp_widget_calendar',
|
||||||
|
@ -104,6 +104,7 @@ require( ABSPATH . WPINC . '/l10n.php' );
|
|||||||
// Run the installer if WordPress is not installed.
|
// Run the installer if WordPress is not installed.
|
||||||
wp_not_installed();
|
wp_not_installed();
|
||||||
|
|
||||||
|
|
||||||
// Load most of WordPress.
|
// Load most of WordPress.
|
||||||
require( ABSPATH . WPINC . '/class-wp-walker.php' );
|
require( ABSPATH . WPINC . '/class-wp-walker.php' );
|
||||||
require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
|
require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
|
||||||
@ -249,7 +250,7 @@ $wp = new WP();
|
|||||||
* @global object $wp_widget_factory
|
* @global object $wp_widget_factory
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*/
|
*/
|
||||||
$wp_widget_factory = new WP_Widget_Factory();
|
$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
|
||||||
|
|
||||||
do_action( 'setup_theme' );
|
do_action( 'setup_theme' );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user