From 961965f252517d2b1ed50d6a2dc9a0d4eb8b27e0 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 26 Sep 2023 15:39:15 +1000 Subject: [PATCH 1/3] Remove null coalescing operator from layout. --- src/wp-includes/block-supports/layout.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/block-supports/layout.php b/src/wp-includes/block-supports/layout.php index 0d299b653695a..04e234f007578 100644 --- a/src/wp-includes/block-supports/layout.php +++ b/src/wp-includes/block-supports/layout.php @@ -549,7 +549,7 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false function wp_render_layout_support_flag( $block_content, $block ) { $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); $block_supports_layout = block_has_support( $block_type, 'layout', false ) || block_has_support( $block_type, '__experimentalLayout', false ); - $layout_from_parent = $block['attrs']['style']['layout']['selfStretch'] ?? null; + $layout_from_parent = isset($block['attrs']['style']['layout']['selfStretch']) ? $block['attrs']['style']['layout']['selfStretch'] : null; if ( ! $block_supports_layout && ! $layout_from_parent ) { return $block_content; @@ -770,7 +770,7 @@ function wp_render_layout_support_flag( $block_content, $block ) { * @var string|null */ $inner_block_wrapper_classes = null; - $first_chunk = $block['innerContent'][0] ?? null; + $first_chunk = isset($block['innerContent'][0]) ? $block['innerContent'][0] : null; if ( is_string( $first_chunk ) && count( $block['innerContent'] ) > 1 ) { $first_chunk_processor = new WP_HTML_Tag_Processor( $first_chunk ); while ( $first_chunk_processor->next_tag() ) { From 8cc4a89c5e96de4ddcd23f5face9a15ee744b4ca Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 26 Sep 2023 16:19:13 +1000 Subject: [PATCH 2/3] Update src/wp-includes/block-supports/layout.php Add spaces inside brackets Co-authored-by: Mukesh Panchal --- src/wp-includes/block-supports/layout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/block-supports/layout.php b/src/wp-includes/block-supports/layout.php index 04e234f007578..992c4c7022bb3 100644 --- a/src/wp-includes/block-supports/layout.php +++ b/src/wp-includes/block-supports/layout.php @@ -549,7 +549,7 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false function wp_render_layout_support_flag( $block_content, $block ) { $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); $block_supports_layout = block_has_support( $block_type, 'layout', false ) || block_has_support( $block_type, '__experimentalLayout', false ); - $layout_from_parent = isset($block['attrs']['style']['layout']['selfStretch']) ? $block['attrs']['style']['layout']['selfStretch'] : null; + $layout_from_parent = isset( $block['attrs']['style']['layout']['selfStretch'] ) ? $block['attrs']['style']['layout']['selfStretch'] : null; if ( ! $block_supports_layout && ! $layout_from_parent ) { return $block_content; From 3a4f129c3aad1528763bed52ae8a937bb77126e8 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 26 Sep 2023 16:19:26 +1000 Subject: [PATCH 3/3] Update src/wp-includes/block-supports/layout.php Add spaces inside brackets Co-authored-by: Mukesh Panchal --- src/wp-includes/block-supports/layout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/block-supports/layout.php b/src/wp-includes/block-supports/layout.php index 992c4c7022bb3..274e0f4168628 100644 --- a/src/wp-includes/block-supports/layout.php +++ b/src/wp-includes/block-supports/layout.php @@ -770,7 +770,7 @@ function wp_render_layout_support_flag( $block_content, $block ) { * @var string|null */ $inner_block_wrapper_classes = null; - $first_chunk = isset($block['innerContent'][0]) ? $block['innerContent'][0] : null; + $first_chunk = isset( $block['innerContent'][0] ) ? $block['innerContent'][0] : null; if ( is_string( $first_chunk ) && count( $block['innerContent'] ) > 1 ) { $first_chunk_processor = new WP_HTML_Tag_Processor( $first_chunk ); while ( $first_chunk_processor->next_tag() ) {