From 87e4d8454b62faa3d578a815f72531436b42a73e Mon Sep 17 00:00:00 2001 From: Mikhaela Tapia Date: Wed, 26 Nov 2025 10:53:34 +0800 Subject: [PATCH] update selector callback --- src/block/posts/style.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/block/posts/style.js b/src/block/posts/style.js index 89068d62c2..b6c0e2ff06 100644 --- a/src/block/posts/style.js +++ b/src/block/posts/style.js @@ -281,26 +281,13 @@ Image.addStyles( blockStyles, { const blockStyle = getBlockStyle( variations, className ) return ! [ 'list', 'horizontal', 'horizontal-2', 'portfolio', 'portfolio-2', 'vertical-card-2' ].includes( blockStyle?.name ) }, - saveEnableWidthCallback: getAttribute => { - const className = getAttribute( 'className' ) - const imageHasLink = getAttribute( 'imageHasLink' ) - const blockStyle = getBlockStyle( variations, className ) - - if ( [ 'horizontal', 'horizontal-2' ].includes( blockStyle?.name ) ) { - if ( imageHasLink ) { - return false - } - return true - } - return true - }, selectorCallback: ( getAttribute, _attributes, _clientId, props ) => { const className = getAttribute( 'className' ) const blockStyle = getBlockStyle( variations, className ) const imageHasLink = getAttribute( 'imageHasLink' ) const selector = props.selector - if ( [ 'list' ].includes( blockStyle?.name ) && imageHasLink ) { + if ( [ 'list', 'horizontal', 'horizontal-2' ].includes( blockStyle?.name ) && imageHasLink ) { return Array.isArray( selector ) ? [ ...selector, `${ itemSelector } .stk-block-posts__image-link` ] : [ selector, `${ itemSelector } .stk-block-posts__image-link` ] @@ -312,7 +299,7 @@ Image.addStyles( blockStyles, { const blockStyle = getBlockStyle( variations, className ) const imageHasLink = getAttribute( 'imageHasLink' ) - if ( [ 'list' ].includes( blockStyle?.name ) && imageHasLink ) { + if ( [ 'list', 'horizontal', 'horizontal-2' ].includes( blockStyle?.name ) && imageHasLink ) { return 'flexBasis' } return 'width'