From 5ccbf34eaa2b3cfac7432f4a72d0d42bd8cf41ba Mon Sep 17 00:00:00 2001 From: Weston Ruter <weston@xwp.co> Date: Thu, 3 Aug 2023 19:22:22 +0000 Subject: [PATCH] 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 --- wp-includes/script-loader.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 0cb6d9f3b1..3447c46016 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -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(). diff --git a/wp-includes/version.php b/wp-includes/version.php index a33bb870ce..1b8cedbaf0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @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.