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
This commit is contained in:
gziolo 2023-03-01 11:47:19 +00:00
parent 12995d49e4
commit b68b0ad84d
2 changed files with 2 additions and 2 deletions

View File

@ -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() ) {

View File

@ -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.