Commit 3939b5692c for wordpress.org

commit 3939b5692cced23ce1d74ade0c040935a2360092
Author: dmsnell <dmsnell@git.wordpress.org>
Date:   Thu Nov 12 02:16:58 2026 +0000

    Blocks: Correctly document the blockName property as being nullable.

    Gutenberg PR#70900 applied several updates to documentation in the PHP block parser, however, as of r61504, the PHP block parser lives in the Core repo. The docs updates were never applied, and this patch backports them into Core.

    See https://github.com/WordPress/gutenberg/pull/70900

    Developed in: https://github.com/WordPress/wordpress-develop/pull/15913
    Discussed in: https://core.trac.wordpress.org/ticket/63663

    Props dmsnell, johnbillion.
    See #63663.

    Built from https://develop.svn.wordpress.org/trunk@65408


    git-svn-id: http://core.svn.wordpress.org/trunk@64547 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/class-wp-block-parser-block.php b/wp-includes/class-wp-block-parser-block.php
index 97dd687c1f..8fbeedd14b 100644
--- a/wp-includes/class-wp-block-parser-block.php
+++ b/wp-includes/class-wp-block-parser-block.php
@@ -14,12 +14,12 @@
  */
 class WP_Block_Parser_Block {
 	/**
-	 * Name of block
+	 * Name of block, or `null` when the block is top-level freeform HTML content.
 	 *
 	 * @example "core/paragraph"
 	 *
 	 * @since 5.0.0
-	 * @var string
+	 * @var string|null
 	 */
 	public $blockName; // phpcs:ignore WordPress.NamingConventions.ValidVariableName

@@ -74,11 +74,11 @@ class WP_Block_Parser_Block {
 	 *
 	 * @since 5.0.0
 	 *
-	 * @param string $name          Name of block.
-	 * @param array  $attrs         Optional set of attributes from block comment delimiters.
-	 * @param array  $inner_blocks  List of inner blocks (of this same class).
-	 * @param string $inner_html    Resultant HTML from inside block comment delimiters after removing inner blocks.
-	 * @param array  $inner_content List of string fragments and null markers where inner blocks were found.
+	 * @param string|null $name          Name of block, or `null` for freeform HTML content.
+	 * @param array       $attrs         Optional set of attributes from block comment delimiters.
+	 * @param array       $inner_blocks  List of inner blocks (of this same class).
+	 * @param string      $inner_html    Resultant HTML from inside block comment delimiters after removing inner blocks.
+	 * @param array       $inner_content List of string fragments and null markers where inner blocks were found.
 	 */
 	public function __construct( $name, $attrs, $inner_blocks, $inner_html, $inner_content ) {
 		$this->blockName    = $name;          // phpcs:ignore WordPress.NamingConventions.ValidVariableName
diff --git a/wp-includes/class-wp-block-parser.php b/wp-includes/class-wp-block-parser.php
index 13c5ac2029..adc49c82ac 100644
--- a/wp-includes/class-wp-block-parser.php
+++ b/wp-includes/class-wp-block-parser.php
@@ -35,6 +35,8 @@ class WP_Block_Parser {
 	/**
 	 * List of parsed blocks
 	 *
+	 * See WP_Block_Parser_Block for the structure of each block.
+	 *
 	 * @since 5.0.0
 	 * @var array[]
 	 */
@@ -70,7 +72,22 @@ class WP_Block_Parser {
 	 *              an empty array unless the document is a stringable object.
 	 *
 	 * @param string $document Input document being parsed.
-	 * @return array[]
+	 * @return array[] {
+	 *     Array of block structures.
+	 *
+	 *     @type array ...$0 {
+	 *         An associative array of a single parsed block object. See WP_Block_Parser_Block.
+	 *
+	 *         @type string|null $blockName    Name of block, or `null` when the block is
+	 *                                         top-level freeform HTML content.
+	 *         @type array       $attrs        Attributes from block comment delimiters.
+	 *         @type array[]     $innerBlocks  List of inner blocks. An array of arrays that
+	 *                                         have the same structure as this one.
+	 *         @type string      $innerHTML    HTML from inside block comment delimiters.
+	 *         @type array       $innerContent List of string fragments and null markers where
+	 *                                         inner blocks were found.
+	 *     }
+	 * }
 	 */
 	public function parse( $document ) {
 		if ( is_object( $document ) && method_exists( $document, '__toString' ) ) {
diff --git a/wp-includes/version.php b/wp-includes/version.php
index f296c9e199..debd22202e 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.2-beta5-65407';
+$wp_version = '7.2-beta5-65408';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.