From 6a0419901cecd4e781cd122df087d5ef3114c8c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Tue, 30 May 2023 18:37:43 +0200 Subject: [PATCH] Fix Mini-Cart block check to see whether a script has already been enqueued (#9649) --- src/BlockTypes/MiniCart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BlockTypes/MiniCart.php b/src/BlockTypes/MiniCart.php index f37d1d13fa5..c3999eccb2c 100644 --- a/src/BlockTypes/MiniCart.php +++ b/src/BlockTypes/MiniCart.php @@ -328,7 +328,7 @@ protected function append_script_and_deps_src( $script ) { $wp_scripts = wp_scripts(); // This script and its dependencies have already been appended. - if ( ! $script || array_key_exists( $script->handle, $this->scripts_to_lazy_load ) || wp_script_is( $script->handle, 'enqueued' ) ) { + if ( ! $script || array_key_exists( $script->handle, $this->scripts_to_lazy_load ) || isset( $wp_scripts->queue[ $script->handle ] ) ) { return; }