From 5fab14051188f87335ed5efdf5e199cf8517149f Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 16 Aug 2023 00:13:45 +0000 Subject: [PATCH] Editor: Use defer loading strategy for block view scripts. Props westonruter, joemcgill. Fixes #59115. git-svn-id: https://develop.svn.wordpress.org/trunk@56398 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/blocks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index f4da0320d4565..97c5951a0e06a 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -170,7 +170,8 @@ function register_block_script_handle( $metadata, $field_name, $index = 0 ) { $script_handle, $script_uri, $script_dependencies, - isset( $script_asset['version'] ) ? $script_asset['version'] : false + isset( $script_asset['version'] ) ? $script_asset['version'] : false, + array( 'strategy' => 'defer' ) ); if ( ! $result ) { return false;