diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index 338c6a041b..eb71951d34 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -374,7 +374,7 @@ function wp_oembed_add_host_js() { * @return string Embed markup (without modifications). */ function wp_maybe_enqueue_oembed_host_js( $html ) { - if ( preg_match( '/]*wp-embedded-content/', $html ) ) { + if ( preg_match( '/]*?wp-embedded-content/', $html ) ) { wp_enqueue_script( 'wp-embed' ); } return $html; @@ -471,11 +471,7 @@ function get_post_embed_html( $width, $height, $post = null ) { $secret = wp_generate_password( 10, false ); $embed_url .= "#?secret={$secret}"; - $output = wp_get_inline_script_tag( - file_get_contents( ABSPATH . WPINC . '/js/wp-embed' . wp_scripts_get_suffix() . '.js' ) - ); - - $output .= sprintf( + $output = sprintf( '
%3$s
', esc_attr( $secret ), esc_url( get_permalink( $post ) ), @@ -498,6 +494,15 @@ function get_post_embed_html( $width, $height, $post = null ) { esc_attr( $secret ) ); + // Note that the script must be placed after the
and