From 2c0047006940ad67b235f11479d9e78759515ca2 Mon Sep 17 00:00:00 2001 From: mxkae Date: Thu, 14 Nov 2024 12:57:33 +0800 Subject: [PATCH] return false for isEligible if no icon block if icon label is modified and does not have icon block, isEligible returns an error --- src/block/icon-label/deprecated.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/block/icon-label/deprecated.js b/src/block/icon-label/deprecated.js index 504e597a5..ae4823925 100644 --- a/src/block/icon-label/deprecated.js +++ b/src/block/icon-label/deprecated.js @@ -12,6 +12,10 @@ const deprecated = [ attributes: attributes( '3.13.1' ), save: withVersion( '3.13.1' )( Save ), isEligible: ( attributes, innerBlocks ) => { + if ( innerBlocks[ 0 ]?.name !== 'stackable/icon' ) { + return false + } + const iconBlockAttributes = innerBlocks[ 0 ].attributes const hasIconSize = iconBlockAttributes.iconSize || iconBlockAttributes.iconSizeTablet || iconBlockAttributes.iconSizeMobile ? true : false const hasIconGap = attributes.iconGap || attributes.iconGapTablet || attributes.iconGapMobile ? true : false