diff --git a/src/wp-includes/class-wp-scripts.php b/src/wp-includes/class-wp-scripts.php index a8f1267236186..18e010dfb83f6 100644 --- a/src/wp-includes/class-wp-scripts.php +++ b/src/wp-includes/class-wp-scripts.php @@ -302,11 +302,16 @@ public function do_item( $handle, $group = false ) { $ver = $ver ? $ver . '&' . $this->args[ $handle ] : $this->args[ $handle ]; } - $src = $obj->src; - $strategy = $this->get_eligible_loading_strategy( $handle ); - $cond_before = ''; - $cond_after = ''; - $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; + $src = $obj->src; + $strategy = $this->get_eligible_loading_strategy( $handle ); + $intended_strategy = $this->get_data( $handle, 'strategy' ); + $cond_before = ''; + $cond_after = ''; + $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; + + if ( ! $this->is_delayed_strategy( (string) $intended_strategy ) ) { + $intended_strategy = ''; + } if ( $conditional ) { $cond_before = "