From d45b50e49043c99cccf1e6e479da61d682950cf4 Mon Sep 17 00:00:00 2001 From: Gilbert Hernandez Date: Thu, 8 Aug 2024 09:18:37 -0600 Subject: [PATCH] KAD-3056 fix for changes --- .../blocks/class-kadence-blocks-advancedgallery-block.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/blocks/class-kadence-blocks-advancedgallery-block.php b/includes/blocks/class-kadence-blocks-advancedgallery-block.php index f71482733..58a24447c 100644 --- a/includes/blocks/class-kadence-blocks-advancedgallery-block.php +++ b/includes/blocks/class-kadence-blocks-advancedgallery-block.php @@ -357,19 +357,20 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { $css->set_media_state( 'desktop'); } + $imageRadiusUnit = isset($attributes['imageRadiusUnit']) ? $attributes['imageRadiusUnit'] : 'px'; if ( isset( $attributes['imageRadius'] ) && is_array( $attributes['imageRadius'] ) && isset( $attributes['imageRadius'][0] ) && is_numeric( $attributes['imageRadius'][0] ) ) { $css->set_selector('.kb-gallery-id-' . $unique_id . ' .kadence-blocks-gallery-item .kb-gal-image-radius' ); - $css->add_property('border-radius', $attributes['imageRadius'][0] . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['imageRadius'][1] ) ? $attributes['imageRadius'][1] : 0 ) . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['imageRadius'][2] ) ? $attributes['imageRadius'][2] : 0 ) . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['imageRadius'][3] ) ? $attributes['imageRadius'][3] : 0 ) . $attributes['imageRadiusUnit'] . ';' ); + $css->add_property('border-radius', $attributes['imageRadius'][0] . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['imageRadius'][1] ) ? $attributes['imageRadius'][1] : 0 ) . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['imageRadius'][2] ) ? $attributes['imageRadius'][2] : 0 ) . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['imageRadius'][3] ) ? $attributes['imageRadius'][3] : 0 ) . $imageRadiusUnit . ';' ); } if ( isset( $attributes['tabletImageRadius'] ) && is_array( $attributes['tabletImageRadius'] ) && isset( $attributes['tabletImageRadius'][0] ) && is_numeric( $attributes['tabletImageRadius'][0] ) ) { $css->set_media_state( 'tablet' ); $css->set_selector('.kb-gallery-id-' . $unique_id . ' .kadence-blocks-gallery-item .kb-gal-image-radius' ); - $css->add_property('border-radius', $attributes['tabletImageRadius'][0] . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['tabletImageRadius'][1] ) ? $attributes['tabletImageRadius'][1] : 0 ) . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['tabletImageRadius'][2] ) ? $attributes['tabletImageRadius'][2] : 0 ) . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['tabletImageRadius'][3] ) ? $attributes['tabletImageRadius'][3] : 0 ) . $attributes['imageRadiusUnit'] . ';' ); + $css->add_property('border-radius', $attributes['tabletImageRadius'][0] . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['tabletImageRadius'][1] ) ? $attributes['tabletImageRadius'][1] : 0 ) . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['tabletImageRadius'][2] ) ? $attributes['tabletImageRadius'][2] : 0 ) . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['tabletImageRadius'][3] ) ? $attributes['tabletImageRadius'][3] : 0 ) . $imageRadiusUnit . ';' ); } if ( isset( $attributes['mobileImageRadius'] ) && is_array( $attributes['mobileImageRadius'] ) && isset( $attributes['mobileImageRadius'][0] ) && is_numeric( $attributes['mobileImageRadius'][0] ) ) { $css->set_media_state( 'mobile' ); $css->set_selector('.kb-gallery-id-' . $unique_id . ' .kadence-blocks-gallery-item .kb-gal-image-radius' ); - $css->add_property('border-radius', $attributes['mobileImageRadius'][0] . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['mobileImageRadius'][1] ) ? $attributes['mobileImageRadius'][1] : 0 ) . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['mobileImageRadius'][2] ) ? $attributes['mobileImageRadius'][2] : 0 ) . $attributes['imageRadiusUnit'] . ' ' . ( is_numeric( $attributes['mobileImageRadius'][3] ) ? $attributes['mobileImageRadius'][3] : 0 ) . $attributes['imageRadiusUnit'] . ';' ); + $css->add_property('border-radius', $attributes['mobileImageRadius'][0] . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['mobileImageRadius'][1] ) ? $attributes['mobileImageRadius'][1] : 0 ) . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['mobileImageRadius'][2] ) ? $attributes['mobileImageRadius'][2] : 0 ) . $imageRadiusUnit . ' ' . ( is_numeric( $attributes['mobileImageRadius'][3] ) ? $attributes['mobileImageRadius'][3] : 0 ) . $imageRadiusUnit . ';' ); } $css->set_media_state( 'desktop' );