Changeset 48135 for trunk/src/wp-includes/class-wp-oembed-controller.php
- Timestamp:
- 06/23/2020 06:06:11 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-oembed-controller.php
r48121 r48135 194 194 195 195 if ( false === $data ) { 196 // Try using a classic embed, instead. 197 global $wp_embed; 198 199 /* @var WP_Embed $wp_embed */ 200 $html = $wp_embed->get_embed_handler_html( $args, $url ); 201 202 if ( $html ) { 203 global $wp_scripts; 204 // Check if any scripts were enqueued by the shortcode, and include them in the response. 205 $enqueued_scripts = array(); 206 207 foreach ( $wp_scripts->queue as $script ) { 208 $enqueued_scripts[] = $wp_scripts->registered[ $script ]->src; 209 } 210 211 return (object) array( 212 'provider_name' => __( 'Embed Handler' ), 213 'html' => $html, 214 'scripts' => $enqueued_scripts, 215 ); 216 } 217 196 218 return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); 197 219 }
Note: See TracChangeset
for help on using the changeset viewer.