From 6276e68c6c240e46e41ff908496129209bb24b11 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 15 Jun 2021 10:24:57 +0000 Subject: [PATCH] Docs: Document the usage of `$wp_embed` global in `WP_oEmbed_Controller::get_proxy_item()`. Follow-up to [48135]. Fixes #52628. Built from https://develop.svn.wordpress.org/trunk@51151 git-svn-id: http://core.svn.wordpress.org/trunk@50760 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-oembed-controller.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-oembed-controller.php b/wp-includes/class-wp-oembed-controller.php index 3e93a8e87a..046c5c0a3a 100644 --- a/wp-includes/class-wp-oembed-controller.php +++ b/wp-includes/class-wp-oembed-controller.php @@ -159,10 +159,14 @@ final class WP_oEmbed_Controller { * @since 4.8.0 * * @see WP_oEmbed::get_html() + * @global WP_Embed $wp_embed + * * @param WP_REST_Request $request Full data about the request. * @return object|WP_Error oEmbed response data or WP_Error on failure. */ public function get_proxy_item( $request ) { + global $wp_embed; + $args = $request->get_params(); // Serve oEmbed data from cache if set. @@ -195,8 +199,6 @@ final class WP_oEmbed_Controller { if ( false === $data ) { // Try using a classic embed, instead. - global $wp_embed; - /* @var WP_Embed $wp_embed */ $html = $wp_embed->get_embed_handler_html( $args, $url ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 753b68ac8b..35a23421c6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta1-51150'; +$wp_version = '5.8-beta1-51151'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.