From b68b0ad84d443d55554e1be4e00d92f12b107232 Mon Sep 17 00:00:00 2001 From: gziolo Date: Wed, 1 Mar 2023 11:47:19 +0000 Subject: [PATCH] Editor: Only add layout classes to inner wrapper if block is a container Backport of https://github.com/WordPress/gutenberg/issues/48606, which fixes an issue found in adding fixtures for deprecated Gallery block versions in #55571. See #55571. Fixes #57831. Props isabel_brison, Mamaduka, dasnitesh780. Built from https://develop.svn.wordpress.org/trunk@55439 git-svn-id: http://core.svn.wordpress.org/trunk@54972 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-supports/layout.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/block-supports/layout.php b/wp-includes/block-supports/layout.php index 40542209d0..bad9430136 100644 --- a/wp-includes/block-supports/layout.php +++ b/wp-includes/block-supports/layout.php @@ -492,7 +492,7 @@ function wp_render_layout_support_flag( $block_content, $block ) { */ $inner_content_classnames = ''; - if ( isset( $block['innerContent'][0] ) && 'string' === gettype( $block['innerContent'][0] ) ) { + if ( isset( $block['innerContent'][0] ) && 'string' === gettype( $block['innerContent'][0] ) && count( $block['innerContent'] ) > 1 ) { $tags = new WP_HTML_Tag_Processor( $block['innerContent'][0] ); $last_classnames = ''; while ( $tags->next_tag() ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 424c4fdc5a..4ba760f78f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-beta3-55438'; +$wp_version = '6.2-beta3-55439'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.