From 813d146239cf4445fcdcb1a28a7547164d90a5f2 Mon Sep 17 00:00:00 2001 From: Maggie Date: Mon, 20 Dec 2021 09:48:02 +0100 Subject: [PATCH] fixed error when no duotone is defined --- blockbase/inc/customizer/wp-customize-colors-preview.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/blockbase/inc/customizer/wp-customize-colors-preview.js b/blockbase/inc/customizer/wp-customize-colors-preview.js index 99ff416cb6..f686990ecb 100644 --- a/blockbase/inc/customizer/wp-customize-colors-preview.js +++ b/blockbase/inc/customizer/wp-customize-colors-preview.js @@ -1,4 +1,8 @@ -var enabledDuotone = duotoneVars[ 'duotoneControl' ] === '1' ? true : false; +var enabledDuotone = false; + +if ( window.duotoneVars ) { + enabledDuotone = duotoneVars[ 'duotoneControl' ] === '1' ? true : false; +} wp.customize( 'duotone_control', ( value ) => { value.bind( ( newValue ) => {