From b144d69ba09fc25297130b1a9963505774686797 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 26 Aug 2016 09:53:28 +0000 Subject: [PATCH] Embed: `wp-settings.php` loads `class-wp-embed.php`, which currently produces side effects. Move the `global` instantiation to `wp-settings.php`. `WP_Embed` is then in a file by itself. See #37827. Built from https://develop.svn.wordpress.org/trunk@38362 git-svn-id: http://core.svn.wordpress.org/trunk@38303 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-embed.php | 1 - wp-includes/version.php | 2 +- wp-settings.php | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-embed.php b/wp-includes/class-wp-embed.php index 17a976f2e6..a8ce4d6c78 100644 --- a/wp-includes/class-wp-embed.php +++ b/wp-includes/class-wp-embed.php @@ -384,4 +384,3 @@ class WP_Embed { return apply_filters( 'embed_maybe_make_link', $output, $url ); } } -$GLOBALS['wp_embed'] = new WP_Embed(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 060c3fc77d..0c530aa49d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38361'; +$wp_version = '4.7-alpha-38362'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-settings.php b/wp-settings.php index abde178b6e..bdf251c27b 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -214,6 +214,8 @@ require( ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' ); require( ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' ); require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); +$GLOBALS['wp_embed'] = new WP_Embed(); + // Load multisite-specific files. if ( is_multisite() ) { require( ABSPATH . WPINC . '/ms-functions.php' );