From ed46d0f45197210468ec906d69443a71f42a73d6 Mon Sep 17 00:00:00 2001 From: Nikita Date: Fri, 30 Jun 2023 18:40:10 +0300 Subject: [PATCH] revert back the ID attribute rendering add this attribute manually because of this Gutenberg's change https://github.com/WordPress/gutenberg/pull/51288 --- classes/class-blocks.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/classes/class-blocks.php b/classes/class-blocks.php index 9f779a6bc..7a6f4c9ca 100644 --- a/classes/class-blocks.php +++ b/classes/class-blocks.php @@ -1592,6 +1592,14 @@ public function render_callback( $attributes, $content = null, $context = 'front $array_atts['class'] .= ' align' . $attributes['align']; } + // The anchor rendering was removed in v3.4.0 because of Gutenberg added support for automatic anchor render. + // Then they are removed this option and we reverted this anchor render back + // + // @link https://github.com/WordPress/gutenberg/pull/51288. + if ( isset( $attributes['anchor'] ) && $attributes['anchor'] ) { + $array_atts['id'] = esc_attr( $attributes['anchor'] ); + } + if ( isset( $attributes['ghostkitSR'] ) && $attributes['ghostkitSR'] ) { $array_atts['data-ghostkit-sr'] = esc_attr( $attributes['ghostkitSR'] ); }