Make WordPress Core

Changeset 55439


Ignore:
Timestamp:
03/01/2023 11:45:22 AM (15 months ago)
Author:
gziolo
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/layout.php

    r55282 r55439  
    493493    $inner_content_classnames = '';
    494494
    495     if ( isset( $block['innerContent'][0] ) && 'string' === gettype( $block['innerContent'][0] ) ) {
     495    if ( isset( $block['innerContent'][0] ) && 'string' === gettype( $block['innerContent'][0] ) && count( $block['innerContent'] ) > 1 ) {
    496496        $tags            = new WP_HTML_Tag_Processor( $block['innerContent'][0] );
    497497        $last_classnames = '';
Note: See TracChangeset for help on using the changeset viewer.