wp/wp-includes/class-wp-oembed-controller.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
--- a/wp/wp-includes/class-wp-oembed-controller.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/class-wp-oembed-controller.php	Wed Sep 21 18:19:35 2022 +0200
@@ -10,7 +10,7 @@
 /**
  * oEmbed API endpoint controller.
  *
- * Registers the API route and delivers the response data.
+ * Registers the REST API route and delivers the response data.
  * The output format (XML or JSON) is handled by the REST API.
  *
  * @since 4.4.0
@@ -159,10 +159,14 @@
 	 * @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 @@
 
 		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 );