From 8f415b964432654b57350d5bd7f02d5f617d08e4 Mon Sep 17 00:00:00 2001 From: Nikita Date: Mon, 7 Oct 2024 16:51:04 +0300 Subject: [PATCH] added URL control content placement fallback --- assets/components/render-controls/index.js | 3 +++ controls/_base/index.php | 2 +- controls/url/index.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/components/render-controls/index.js b/assets/components/render-controls/index.js index 61e6a8d0..91f0f13f 100644 --- a/assets/components/render-controls/index.js +++ b/assets/components/render-controls/index.js @@ -210,6 +210,9 @@ export default class RenderControls extends Component { placementCheck = controlTypeData.restrictions.placement_settings.indexOf( placement + ) > -1 || + controlTypeData.restrictions.placement_settings.indexOf( + `${placement}-fallback` ) > -1; } diff --git a/controls/_base/index.php b/controls/_base/index.php index 72969b68..f2aa68b8 100644 --- a/controls/_base/index.php +++ b/controls/_base/index.php @@ -65,7 +65,7 @@ class LazyBlocks_Control { 'label_settings' => true, 'default_settings' => true, 'help_settings' => true, - 'placement_settings' => array( 'content', 'inspector' ), + 'placement_settings' => array( 'content', 'inspector' /* , 'content-fallback', 'inspector-fallback' */ ), 'width_settings' => true, 'required_settings' => true, 'hide_if_not_selected_settings' => true, diff --git a/controls/url/index.php b/controls/url/index.php index 822d8e95..45862c4a 100644 --- a/controls/url/index.php +++ b/controls/url/index.php @@ -22,7 +22,7 @@ public function __construct() { $this->type = 'string'; $this->label = __( 'URL', 'lazy-blocks' ); $this->restrictions = array( - 'placement_settings' => array( 'inspector' ), + 'placement_settings' => array( 'content-fallback', 'inspector' ), 'translate_settings' => true, );