From 633e5463139b29ea0a884dfa9be35a896336b31e Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Fri, 11 Sep 2026 11:19:54 +0530 Subject: [PATCH 1/2] Use null coalescing operator in WP_Block_Parser::add_inner_block() --- src/wp-includes/class-wp-block-parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-block-parser.php b/src/wp-includes/class-wp-block-parser.php index 81cb7a8fa21f7..f01cc1741bccd 100644 --- a/src/wp-includes/class-wp-block-parser.php +++ b/src/wp-includes/class-wp-block-parser.php @@ -352,7 +352,7 @@ public function add_inner_block( WP_Block_Parser_Block $block, $token_start, $to } $parent->block->innerContent[] = null; - $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; + $parent->prev_offset = $last_offset ?? $token_start + $token_length; } /** From a245c327b363fd1705c0058c4abb54661df65bf8 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Fri, 11 Sep 2026 15:28:11 +0530 Subject: [PATCH 2/2] Use null coalescing operator for length assignment --- src/wp-includes/class-wp-block-parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-block-parser.php b/src/wp-includes/class-wp-block-parser.php index f01cc1741bccd..9ad4aa28f8099 100644 --- a/src/wp-includes/class-wp-block-parser.php +++ b/src/wp-includes/class-wp-block-parser.php @@ -321,7 +321,7 @@ public function freeform( $inner_html ) { * @param null|int $length How many bytes of document text to output. */ public function add_freeform( $length = null ) { - $length = $length ? $length : strlen( $this->document ) - $this->offset; + $length = $length ?? strlen( $this->document ) - $this->offset; if ( 0 === $length ) { return;