Make WordPress Core


Ignore:
Timestamp:
07/25/2025 02:57:09 PM (6 months ago)
Author:
johnbillion
Message:

Docs: Improve the documented return type for parsed blocks.

The blockName property can be null, for example when a section of HTML outside of a block is encountered. This corrects the docs to reflect that.

Props jeremyfelt, pmbaldha, johnbillion.

Fixes #63663

File:
1 edited

Legend:

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

    r60325 r60511  
    3030     *
    3131     * @since 5.5.0
    32      * @var string
     32     * @var string|null
    3333     */
    3434    public $name;
     
    115115     *     An associative array of a single parsed block object. See WP_Block_Parser_Block.
    116116     *
    117      *     @type string  $blockName    Name of block.
    118      *     @type array    $attrs        Attributes from block comment delimiters.
    119      *     @type array    $innerBlocks  List of inner blocks. An array of arrays that
    120      *                                  have the same structure as this one.
    121      *     @type string   $innerHTML    HTML from inside block comment delimiters.
    122      *     @type array    $innerContent List of string fragments and null markers where inner blocks were found.
     117     *     @type string|null $blockName    Name of block.
     118     *     @type array       $attrs        Attributes from block comment delimiters.
     119     *     @type array       $innerBlocks  List of inner blocks. An array of arrays that
     120     *                                     have the same structure as this one.
     121     *     @type string      $innerHTML    HTML from inside block comment delimiters.
     122     *     @type array       $innerContent List of string fragments and null markers where inner blocks were found.
    123123     * }
    124124     * @param array                  $available_context Optional array of ancestry context values.
Note: See TracChangeset for help on using the changeset viewer.