diff --git a/wp-includes/class-wp-scripts.php b/wp-includes/class-wp-scripts.php index 857f1e948b..0c85201bad 100644 --- a/wp-includes/class-wp-scripts.php +++ b/wp-includes/class-wp-scripts.php @@ -907,9 +907,19 @@ JS; * @return string The best eligible loading strategy. */ private function get_eligible_loading_strategy( $handle ) { - $eligible = $this->filter_eligible_strategies( $handle ); + $intended = (string) $this->get_data( $handle, 'strategy' ); - // Bail early once we know the eligible strategy is blocking. + // Bail early if there is no intended strategy. + if ( ! $intended ) { + return ''; + } + + // If the intended strategy is 'defer', limit the initial list of eligibles. + $initial = ( 'defer' === $intended ) ? array( 'defer' ) : null; + + $eligible = $this->filter_eligible_strategies( $handle, $initial ); + + // Return early once we know the eligible strategy is blocking. if ( empty( $eligible ) ) { return ''; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 85fbeee08f..0c9ed48785 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-56091'; +$wp_version = '6.3-alpha-56092'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.