Skip to content

Commit 0e03efa

Browse files
Merge pull request #889 from stellarwp/release/3.5.31
hotfix bumped this version
2 parents 89ecfab + f31dcc1 commit 0e03efa

File tree

12 files changed

+105
-14
lines changed

12 files changed

+105
-14
lines changed

includes/blocks/class-kadence-blocks-advanced-heading-block.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,30 @@ public function register_scripts() {
638638
return;
639639
}
640640
wp_register_style( 'kadence-blocks-' . $this->block_name, false );
641-
$heading_css = '.wp-block-kadence-advancedheading mark{background:transparent;border-style:solid;border-width:0}.wp-block-kadence-advancedheading mark.kt-highlight{color:#f76a0c;}.kb-adv-heading-icon{display: inline-flex;justify-content: center;align-items: center;} .is-layout-constrained > .kb-advanced-heading-link {display: block;}';
641+
$heading_css = <<<'CSS'
642+
.wp-block-kadence-advancedheading mark{background:transparent;border-style:solid;border-width:0}
643+
.wp-block-kadence-advancedheading mark.kt-highlight{color:#f76a0c;}
644+
.kb-adv-heading-icon{display: inline-flex;justify-content: center;align-items: center;}
645+
.is-layout-constrained > .kb-advanced-heading-link {display: block;}
646+
CSS;
647+
648+
// Style to prevent padding conflict with WordPress core style for headings and paragraphs.
649+
// Reference: https://stellarwp.atlassian.net/browse/KAD-5283
650+
$heading_css .= '.wp-block-kadence-advancedheading.has-background{padding: 0;}';
651+
642652
// Short term fix for an issue with heading wrapping.
643653
if ( class_exists( '\Kadence\Theme' ) ) {
644-
$heading_css .= '.single-content .kadence-advanced-heading-wrapper h1, .single-content .kadence-advanced-heading-wrapper h2, .single-content .kadence-advanced-heading-wrapper h3, .single-content .kadence-advanced-heading-wrapper h4, .single-content .kadence-advanced-heading-wrapper h5, .single-content .kadence-advanced-heading-wrapper h6 {margin: 1.5em 0 .5em;}.single-content .kadence-advanced-heading-wrapper+* { margin-top:0;}';
654+
$heading_css .= <<<'CSS'
655+
.single-content .kadence-advanced-heading-wrapper h1,
656+
.single-content .kadence-advanced-heading-wrapper h2,
657+
.single-content .kadence-advanced-heading-wrapper h3,
658+
.single-content .kadence-advanced-heading-wrapper h4,
659+
.single-content .kadence-advanced-heading-wrapper h5,
660+
.single-content .kadence-advanced-heading-wrapper h6 {margin: 1.5em 0 .5em;}
661+
.single-content .kadence-advanced-heading-wrapper+* { margin-top:0;}
662+
CSS;
645663
}
664+
646665
// Add screen reader text styles
647666
$heading_css .= '.kb-screen-reader-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);}';
648667
wp_add_inline_style( 'kadence-blocks-' . $this->block_name, $heading_css );

includes/blocks/class-kadence-blocks-column-block.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
744744
}
745745
if ( isset( $attributes['collapseOrder'] ) ) {
746746
$css->set_selector( '.kt-row-column-wrap.kt-mobile-layout-three-grid > .kadence-column' . $unique_id . ', .kt-row-column-wrap.kt-mobile-layout-two-grid > .kadence-column' . $unique_id . ', .kt-row-column-wrap.kt-mobile-layout-row > .kadence-column' . $unique_id );
747-
$css->add_property( 'order', $attributes['collapseOrder'] );
747+
$css->add_property( 'order', $attributes['collapseOrder'] . ' !important' );
748748
}
749749
if ( ! empty( $attributes['textAlign'][2] ) ) {
750750
$css->set_selector( '.kadence-column' . $unique_id );

includes/class-kadence-blocks-editor-assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ public function early_editor_assets() {
813813
return;
814814
}
815815
global $pagenow;
816-
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow || 'widgets.php' === $pagenow ) {
816+
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow || 'widgets.php' === $pagenow || 'site-editor.php' === $pagenow ) {
817817
wp_localize_script(
818818
'kadence-blocks-js',
819819
'kadence_blocks_user_params',

includes/settings/class-kadence-blocks-settings.php

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function __construct() {
8181
add_action( 'init', [ $this, 'load_api_settings' ] );
8282
add_action( 'after_setup_theme', [ $this, 'load_color_palette' ], 999 );
8383
add_filter( 'block_editor_settings_all', [ $this, 'load_color_palette_editor_settings' ], 999 );
84+
add_filter( 'wp_theme_json_data_theme', [ $this, 'load_color_palette_theme_json' ], 999 );
8485
add_action( 'init', [ $this, 'init_post_meta' ] );
8586
add_action( 'admin_head-post.php', [ $this, 'admin_editor_width' ], 100 );
8687
add_action( 'admin_head-post-new.php', [ $this, 'admin_editor_width' ], 100 );
@@ -416,9 +417,70 @@ public function load_color_palette_editor_settings( $settings ) {
416417
}
417418
}
418419
}
419-
420420
return $settings;
421421
}
422+
/**
423+
* Load custom colors into theme.json for Site Editor compatibility.
424+
*
425+
* @param WP_Theme_JSON_Data $theme_json The theme.json data object.
426+
* @return WP_Theme_JSON_Data Modified theme.json data.
427+
*/
428+
public function load_color_palette_theme_json( $theme_json ) {
429+
$palette = json_decode( get_option( 'kadence_blocks_colors' ), true );
430+
if ( isset( $palette['palette'] ) && is_array( $palette['palette'] ) && ! empty( $palette['palette'] ) ) {
431+
$san_palette = [];
432+
foreach ( $palette['palette'] as $item ) {
433+
$san_palette[] = [
434+
'color' => $item['color'],
435+
'name' => $item['name'],
436+
'slug' => $item['slug'],
437+
];
438+
}
439+
if ( ! empty( $san_palette ) ) {
440+
$data = $theme_json->get_data();
441+
$override = isset( $palette['override'] ) && true === $palette['override'];
442+
443+
if ( $override ) {
444+
// Override mode: only show custom colors, replace theme palette.
445+
$theme_json->update_with(
446+
[
447+
'version' => 2,
448+
'settings' => [
449+
'color' => [
450+
'palette' => [
451+
'theme' => $san_palette,
452+
],
453+
],
454+
],
455+
]
456+
);
457+
} else {
458+
// Merge mode: add custom colors to theme palette.
459+
$existing_theme = isset( $data['settings']['color']['palette']['theme'] )
460+
? $data['settings']['color']['palette']['theme']
461+
: [];
462+
463+
// Merge custom colors with theme palette.
464+
$merged_palette = array_merge( $existing_theme, $san_palette );
465+
$merged_palette = array_values( array_map( 'unserialize', array_unique( array_map( 'serialize', $merged_palette ) ) ) );
466+
467+
$theme_json->update_with(
468+
[
469+
'version' => 2,
470+
'settings' => [
471+
'color' => [
472+
'palette' => [
473+
'theme' => $merged_palette,
474+
],
475+
],
476+
],
477+
]
478+
);
479+
}
480+
}
481+
}
482+
return $theme_json;
483+
}
422484
/**
423485
* Load Gutenberg Palette
424486
*/

kadence-blocks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Advanced Page Building Blocks for Gutenberg. Create custom column layouts, backgrounds, dual buttons, icons etc.
66
* Author: Kadence WP
77
* Author URI: https://www.kadencewp.com
8-
* Version: 3.5.30
8+
* Version: 3.5.31
99
* Requires PHP: 7.4
1010
* Text Domain: kadence-blocks
1111
* License: GPL2+
@@ -20,7 +20,7 @@
2020
}
2121
define( 'KADENCE_BLOCKS_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
2222
define( 'KADENCE_BLOCKS_URL', plugin_dir_url( __FILE__ ) );
23-
define( 'KADENCE_BLOCKS_VERSION', '3.5.30' );
23+
define( 'KADENCE_BLOCKS_VERSION', '3.5.31' );
2424

2525
require_once plugin_dir_path( __FILE__ ) . 'vendor/vendor-prefixed/autoload.php';
2626
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: gutenberg, blocks, page builder, editor, gutenberg blocks
44
Donate link: https://www.kadencewp.com/about-us/
55
Requires at least: 6.6
66
Tested up to: 6.9
7-
Stable tag: 3.5.30
7+
Stable tag: 3.5.31
88
Requires PHP: 7.4
99
License: GPLv2 or later
1010
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -174,6 +174,9 @@ Please report security bugs found in the Kadence Blocks plugin's source code thr
174174

175175
== Changelog ==
176176

177+
= 3.5.31 =
178+
Release Date: 15th January 2026
179+
177180
= 3.5.30 =
178181
Release Date: 8th January 2026
179182
* Add: Classic adv form transform tool to new form block.

src/blocks/advancedheading/editor.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,4 +665,10 @@ button.components-button.kt-font-clear-btn {
665665
pointer-events: none;
666666
z-index: 1;
667667
}
668-
}
668+
}
669+
670+
// We notice a style conflict with WordPress styles in Gutenberg editor.
671+
// A padding adds to heading tag if it has class "has-background" along with "has-theme-palette-*" class.
672+
// This CSS rule will override that padding issue.
673+
// Reference: https://stellarwp.atlassian.net/browse/KAD-5283
674+
.kadence-advancedheading-text.has-background{padding: 0;}

src/blocks/column/edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ function SectionEdit(props) {
14331433
? `.kt-row-layout-row > .innerblocks-wrap > .kadence-column-${uniqueID} { order:${collapseOrder}; }`
14341434
: ''}
14351435
{collapseOrder && previewDevice === 'Mobile'
1436-
? `.kadence-column-${uniqueID} { order:${collapseOrder}; }`
1436+
? `.kadence-column-${uniqueID} { order:${collapseOrder} !important; }`
14371437
: ''}
14381438

14391439
{displayHoverShadow &&

src/blocks/form/block.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@
375375
"ktanimateadd": true,
376376
"ktanimatepreview": true,
377377
"ktanimateswipe": true,
378-
"kbMetadata": true
378+
"kbMetadata": true,
379+
"inserter": false
379380
},
380381
"usesContext": ["postId"]
381382
}

src/blocks/header/children/off-canvas/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $admin-bar-height-mobile: 46px;
4444
@include open-right-styles();
4545
}
4646
}
47-
&.open-tablet-right {
47+
&.open-mobile-right {
4848
@media (max-width: vars.$phone-minus-query) {
4949
@include open-right-styles();
5050
}

0 commit comments

Comments
 (0)