diff --git a/includes/blocks/header/class-kadence-blocks-header-column-block.php b/includes/blocks/header/class-kadence-blocks-header-column-block.php index 95ebb578d..532f30c7e 100644 --- a/includes/blocks/header/class-kadence-blocks-header-column-block.php +++ b/includes/blocks/header/class-kadence-blocks-header-column-block.php @@ -98,7 +98,7 @@ public function build_html( $attributes, $unique_id, $content, $block_instance ) if ( ! empty( $attributes['location'] ) && ! in_array( $attributes['location'], array( 'tablet-left', 'tablet-right', 'center-left', 'center', 'center-right' ) ) ) { // If no center content, return empty div to keep layout consistent. - if( $attributes['location'] === 'tablet-center' && empty( $content ) ) { + if ( $attributes['location'] === 'tablet-center' && empty( $content ) ) { return '
'; } @@ -122,10 +122,9 @@ public function build_html( $attributes, $unique_id, $content, $block_instance ) $content = '' . $content; } } - if ( empty( $content ) ) { $classes[] = 'no-content'; - if ( ! empty( $attributes['location'] ) && $attributes['location'] == 'center' ) { + if ( ! empty( $attributes['location'] ) && ( 'center' === $attributes['location'] || 'tablet-center' === $attributes['location'] ) ) { $classes[] = 'no-content-column-center'; } } diff --git a/src/blocks/header/templates/basic-1.js b/src/blocks/header/templates/basic-1.js index 18e7f905e..99add0155 100644 --- a/src/blocks/header/templates/basic-1.js +++ b/src/blocks/header/templates/basic-1.js @@ -339,7 +339,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_96ebcd-88', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -389,7 +390,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_4503bc-d7', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( @@ -430,7 +432,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_1241a8-a6', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/basic-2.js b/src/blocks/header/templates/basic-2.js index 6e5f7e930..aee3c00fd 100644 --- a/src/blocks/header/templates/basic-2.js +++ b/src/blocks/header/templates/basic-2.js @@ -334,7 +334,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_552a9f-e7', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -376,7 +377,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_16a0d7-83', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -404,7 +406,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_c839f3-8d', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/basic-3.js b/src/blocks/header/templates/basic-3.js index 41a5e087d..d1f00c13d 100644 --- a/src/blocks/header/templates/basic-3.js +++ b/src/blocks/header/templates/basic-3.js @@ -342,7 +342,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_8e1cce-17', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -379,7 +380,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_7048f8-e9', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( @@ -434,7 +436,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_ee92c3-ac', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/basic-4.js b/src/blocks/header/templates/basic-4.js index f730f2318..98eee1c22 100644 --- a/src/blocks/header/templates/basic-4.js +++ b/src/blocks/header/templates/basic-4.js @@ -287,7 +287,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_44d96b-23', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -316,7 +317,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_378ead-16', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -344,7 +346,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_9324ca-ec', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/basic-5.js b/src/blocks/header/templates/basic-5.js index d3834d474..762b27b47 100644 --- a/src/blocks/header/templates/basic-5.js +++ b/src/blocks/header/templates/basic-5.js @@ -334,7 +334,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_c2473b-5d', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -375,7 +376,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_d71e8e-0c', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -436,7 +438,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_8716fa-e6', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/basic-6.js b/src/blocks/header/templates/basic-6.js index 817a945bd..1b5d385c4 100644 --- a/src/blocks/header/templates/basic-6.js +++ b/src/blocks/header/templates/basic-6.js @@ -485,7 +485,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_2102c6-23', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -526,7 +527,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_c2e29f-f3', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -649,7 +651,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_f52042-78', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/basic-7.js b/src/blocks/header/templates/basic-7.js index 518987c96..e387e2e64 100644 --- a/src/blocks/header/templates/basic-7.js +++ b/src/blocks/header/templates/basic-7.js @@ -311,7 +311,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_a628c2-31', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -352,7 +353,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_c2fbc3-92', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -399,7 +401,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '10_d5ddbd-e2', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/blank.js b/src/blocks/header/templates/blank.js index a1dd23923..ad1ed7068 100644 --- a/src/blocks/header/templates/blank.js +++ b/src/blocks/header/templates/blank.js @@ -254,7 +254,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_96ebcd-88', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -291,7 +292,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_4503bc-d7', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -320,7 +322,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '6_1241a8-a6', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/mobile-1.js b/src/blocks/header/templates/mobile-1.js index fe3c3be53..8faa769c4 100644 --- a/src/blocks/header/templates/mobile-1.js +++ b/src/blocks/header/templates/mobile-1.js @@ -338,7 +338,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '42_4e4853-63', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -388,7 +389,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '42_c5037b-3f', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( @@ -429,7 +431,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '42_a6e551-1c', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/mobile-2.js b/src/blocks/header/templates/mobile-2.js index f9cea1f2a..fb13cf1de 100644 --- a/src/blocks/header/templates/mobile-2.js +++ b/src/blocks/header/templates/mobile-2.js @@ -323,7 +323,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '56_f363d3-79', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -373,7 +374,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '56_2a5574-34', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( @@ -414,7 +416,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '56_1fe859-b7', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/mobile-3.js b/src/blocks/header/templates/mobile-3.js index 487cc26c9..29b349341 100644 --- a/src/blocks/header/templates/mobile-3.js +++ b/src/blocks/header/templates/mobile-3.js @@ -292,7 +292,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '75_98c204-ff', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -343,7 +344,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '75_aba572-6e', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -381,7 +383,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '75_218b70-b2', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/mobile-4.js b/src/blocks/header/templates/mobile-4.js index 758e43130..c365a7dbc 100644 --- a/src/blocks/header/templates/mobile-4.js +++ b/src/blocks/header/templates/mobile-4.js @@ -444,7 +444,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '88_a61084-4e', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -494,7 +495,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '88_1e6337-10', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( @@ -555,7 +557,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '88_ef28da-f8', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/multi-row-1.js b/src/blocks/header/templates/multi-row-1.js index 4b4ab4e0c..69d0015cb 100644 --- a/src/blocks/header/templates/multi-row-1.js +++ b/src/blocks/header/templates/multi-row-1.js @@ -390,7 +390,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_1791f5-df', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -444,7 +445,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_2d1e60-a9', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -484,7 +486,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_b92c1b-3d', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/multi-row-2.js b/src/blocks/header/templates/multi-row-2.js index 6f708666d..505b56b1a 100644 --- a/src/blocks/header/templates/multi-row-2.js +++ b/src/blocks/header/templates/multi-row-2.js @@ -432,7 +432,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_b5c118-e9', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -490,7 +491,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_27b60f-a0', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( @@ -532,7 +534,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_2c4abc-e6', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/multi-row-3.js b/src/blocks/header/templates/multi-row-3.js index f31be8a09..ea0103b67 100644 --- a/src/blocks/header/templates/multi-row-3.js +++ b/src/blocks/header/templates/multi-row-3.js @@ -429,7 +429,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_0be155-f9', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( @@ -514,7 +515,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_65af20-8c', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -555,7 +557,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_5756d8-9c', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), diff --git a/src/blocks/header/templates/multi-row-4.js b/src/blocks/header/templates/multi-row-4.js index 8f40b065b..224101641 100644 --- a/src/blocks/header/templates/multi-row-4.js +++ b/src/blocks/header/templates/multi-row-4.js @@ -366,7 +366,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_450dc9-7d', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -413,7 +414,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_a273a9-b3', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( diff --git a/src/blocks/header/templates/multi-row-5.js b/src/blocks/header/templates/multi-row-5.js index 0d1a7f290..ad7b341bb 100644 --- a/src/blocks/header/templates/multi-row-5.js +++ b/src/blocks/header/templates/multi-row-5.js @@ -447,7 +447,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_a6dc83-53', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [ createBlock( @@ -546,7 +547,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_04c9c7-f1', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ), @@ -587,7 +589,8 @@ function innerBlocks() { 'kadence/header-column', { uniqueID: '8_803649-37', - metadata: { name: 'Center', location: 'tablet-center' }, + location: 'tablet-center', + metadata: { name: 'Center' }, }, [] ),