Script Loader: Use defer loading strategy for wp-embed script and move to head (in block themes).

Props westonruter, flixos90, swissspidy.
Fixes #58931.

Built from https://develop.svn.wordpress.org/trunk@56355


git-svn-id: http://core.svn.wordpress.org/trunk@55867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2023-08-03 19:22:22 +00:00
parent 7d0d2b0edf
commit 5ccbf34eaa
2 changed files with 3 additions and 2 deletions

View File

@ -1349,7 +1349,8 @@ function wp_default_scripts( $scripts ) {
) )
); );
$scripts->add( 'wp-embed', "/wp-includes/js/wp-embed$suffix.js", array(), false, 1 ); $scripts->add( 'wp-embed', "/wp-includes/js/wp-embed$suffix.js" );
did_action( 'init' ) && $scripts->add_data( 'wp-embed', 'strategy', 'defer' );
/* /*
* To enqueue media-views or media-editor, call wp_enqueue_media(). * To enqueue media-views or media-editor, call wp_enqueue_media().

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-alpha-56354'; $wp_version = '6.4-alpha-56355';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.