Skip to content

Commit

Permalink
Editor: remove Group inner container from Grid variation in classic t…
Browse files Browse the repository at this point in the history
…hemes.

Updates the logic in the layout filter that replaces the Group block inner container in classic themes to exclude the Grid variation.

Props isabel_brison, aaronrobertshaw, andrewserong.
See #61635.



git-svn-id: https://develop.svn.wordpress.org/trunk@58708 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
tellthemachines committed Jul 12, 2024
1 parent f1489fb commit 18250a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wp-includes/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ function wp_add_parent_layout_to_parsed_block( $parsed_block, $source_block, $pa
* to avoid breaking styles relying on that div.
*
* @since 5.8.0
* @since 6.6.1 Removed inner container from Grid variations.
* @access private
*
* @param string $block_content Rendered block content.
Expand All @@ -967,7 +968,7 @@ function wp_restore_group_inner_container( $block_content, $block ) {
if (
wp_theme_has_theme_json() ||
1 === preg_match( $group_with_inner_container_regex, $block_content ) ||
( isset( $block['attrs']['layout']['type'] ) && 'flex' === $block['attrs']['layout']['type'] )
( isset( $block['attrs']['layout']['type'] ) && ( 'flex' === $block['attrs']['layout']['type'] || 'grid' === $block['attrs']['layout']['type'] ) )
) {
return $block_content;
}
Expand Down

0 comments on commit 18250a4

Please sign in to comment.