From 1b292c965acf4d045328af57c6310c8f337185e6 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 26 Aug 2016 09:52:18 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@38362 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-embed.php | 1 - src/wp-settings.php | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-embed.php b/src/wp-includes/class-wp-embed.php index 17a976f2e6..a8ce4d6c78 100644 --- a/src/wp-includes/class-wp-embed.php +++ b/src/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/src/wp-settings.php b/src/wp-settings.php index abde178b6e..bdf251c27b 100644 --- a/src/wp-settings.php +++ b/src/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' );