From 7381fbbbdc2ae1a768f78299319fcf0d65abf2ce Mon Sep 17 00:00:00 2001 From: Kai Hao Date: Thu, 27 May 2021 13:33:30 +0800 Subject: [PATCH] Move is_widget_customizer_js_value elsewhere --- .../src/components/sidebar-block-editor/sidebar-adapter.js | 2 -- .../components/sidebar-block-editor/use-sidebar-block-editor.js | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/customize-widgets/src/components/sidebar-block-editor/sidebar-adapter.js b/packages/customize-widgets/src/components/sidebar-block-editor/sidebar-adapter.js index 26be41fff59ae3..d3046669d9b161 100644 --- a/packages/customize-widgets/src/components/sidebar-block-editor/sidebar-adapter.js +++ b/packages/customize-widgets/src/components/sidebar-block-editor/sidebar-adapter.js @@ -182,8 +182,6 @@ export default class SidebarAdapter { number = widgetModel.get( 'multi_number' ); } - widget.instance.is_widget_customizer_js_value = true; - const settingId = number ? `widget_${ widget.idBase }[${ number }]` : `widget_${ widget.idBase }`; diff --git a/packages/customize-widgets/src/components/sidebar-block-editor/use-sidebar-block-editor.js b/packages/customize-widgets/src/components/sidebar-block-editor/use-sidebar-block-editor.js index a1366b4d1bf83d..340aca24cb61d7 100644 --- a/packages/customize-widgets/src/components/sidebar-block-editor/use-sidebar-block-editor.js +++ b/packages/customize-widgets/src/components/sidebar-block-editor/use-sidebar-block-editor.js @@ -32,6 +32,8 @@ function blockToWidget( block, existingWidget = null ) { idBase: block.attributes.idBase, instance: { ...existingWidget?.instance, + // Required only for the customizer. + is_widget_customizer_js_value: true, encoded_serialized_instance: encoded, instance_hash_key: hash, raw_instance: raw,