Make WordPress Core


Ignore:
Timestamp:
05/02/2024 07:52:42 PM (9 months ago)
Author:
johnbillion
Message:

Docs: Document the array shapes for parsed blocks, template part areas, and template types.

See #60699

File:
1 edited

Legend:

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

    r56945 r58084  
    5050
    5151    /**
    52      * Parses a document and returns a list of block structures
     52     * Parses a document and returns a list of block structures.
    5353     *
    5454     * When encountering an invalid parse will return a best-effort
     
    5959     *
    6060     * @param string $document Input document being parsed.
    61      * @return array[]
     61     * @return array[] {
     62     *     Array of block structures.
     63     *
     64     *     @type array ...$0 {
     65     *         A representative array of a single parsed block object. See WP_Block_Parser_Block.
     66     *
     67     *         @type string   $blockName    Name of block.
     68     *         @type array    $attrs        Attributes from block comment delimiters.
     69     *         @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     70     *                                      have the same structure as this one.
     71     *         @type string   $innerHTML    HTML from inside block comment delimiters.
     72     *         @type array    $innerContent List of string fragments and null markers where
     73     *                                      inner blocks were found.
     74     *     }
     75     * }
    6276     */
    6377    public function parse( $document ) {
Note: See TracChangeset for help on using the changeset viewer.