Make WordPress Core


Ignore:
Timestamp:
05/02/2024 07:52:42 PM (22 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/blocks.php

    r57677 r58084  
    12021202 * @since 5.3.1
    12031203 *
    1204  * @param array $block A representative array of a single parsed block object. See WP_Block_Parser_Block.
     1204 * @param array $block {
     1205 *     A representative array of a single parsed block object. See WP_Block_Parser_Block.
     1206 *
     1207 *     @type string   $blockName    Name of block.
     1208 *     @type array    $attrs        Attributes from block comment delimiters.
     1209 *     @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     1210 *                                  have the same structure as this one.
     1211 *     @type string   $innerHTML    HTML from inside block comment delimiters.
     1212 *     @type array    $innerContent List of string fragments and null markers where
     1213 *                                  inner blocks were found.
     1214 * }
    12051215 * @return string String of rendered HTML.
    12061216 */
     
    12301240 * @since 5.3.1
    12311241 *
    1232  * @param array[] $blocks An array of representative arrays of parsed block objects. See serialize_block().
     1242 * @param array[] $blocks {
     1243 *     Array of block structures.
     1244 *
     1245 *     @type array ...$0 {
     1246 *         A representative array of a single parsed block object. See WP_Block_Parser_Block.
     1247 *
     1248 *         @type string   $blockName    Name of block.
     1249 *         @type array    $attrs        Attributes from block comment delimiters.
     1250 *         @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     1251 *                                      have the same structure as this one.
     1252 *         @type string   $innerHTML    HTML from inside block comment delimiters.
     1253 *         @type array    $innerContent List of string fragments and null markers where
     1254 *                                      inner blocks were found.
     1255 *     }
     1256 * }
    12331257 * @return string String of rendered HTML.
    12341258 */
     
    16391663 * @global WP_Post $post The post to edit.
    16401664 *
    1641  * @param array $parsed_block A single parsed block object.
     1665 * @param array $parsed_block {
     1666 *     A representative array of the block being rendered. See WP_Block_Parser_Block.
     1667 *
     1668 *     @type string   $blockName    Name of block.
     1669 *     @type array    $attrs        Attributes from block comment delimiters.
     1670 *     @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     1671 *                                  have the same structure as this one.
     1672 *     @type string   $innerHTML    HTML from inside block comment delimiters.
     1673 *     @type array    $innerContent List of string fragments and null markers where
     1674 *                                  inner blocks were found.
     1675 * }
    16421676 * @return string String of rendered HTML.
    16431677 */
     
    16531687     *
    16541688     * @param string|null   $pre_render   The pre-rendered content. Default null.
    1655      * @param array         $parsed_block The block being rendered.
     1689     * @param array         $parsed_block {
     1690     *     A representative array of the block being rendered. See WP_Block_Parser_Block.
     1691     *
     1692     *     @type string   $blockName    Name of block.
     1693     *     @type array    $attrs        Attributes from block comment delimiters.
     1694     *     @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     1695     *                                  have the same structure as this one.
     1696     *     @type string   $innerHTML    HTML from inside block comment delimiters.
     1697     *     @type array    $innerContent List of string fragments and null markers where
     1698     *                                  inner blocks were found.
     1699     * }
    16561700     * @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
    16571701     */
     
    16691713     * @since 5.9.0 The `$parent_block` parameter was added.
    16701714     *
    1671      * @param array         $parsed_block The block being rendered.
    1672      * @param array         $source_block An un-modified copy of $parsed_block, as it appeared in the source content.
     1715     * @param array         $parsed_block {
     1716     *     A representative array of the block being rendered. See WP_Block_Parser_Block.
     1717     *
     1718     *     @type string   $blockName    Name of block.
     1719     *     @type array    $attrs        Attributes from block comment delimiters.
     1720     *     @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     1721     *                                  have the same structure as this one.
     1722     *     @type string   $innerHTML    HTML from inside block comment delimiters.
     1723     *     @type array    $innerContent List of string fragments and null markers where
     1724     *                                  inner blocks were found.
     1725     * }
     1726     * @param array         $source_block {
     1727     *     An un-modified copy of `$parsed_block`, as it appeared in the source content.
     1728     *     See WP_Block_Parser_Block.
     1729     *
     1730     *     @type string   $blockName    Name of block.
     1731     *     @type array    $attrs        Attributes from block comment delimiters.
     1732     *     @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     1733     *                                  have the same structure as this one.
     1734     *     @type string   $innerHTML    HTML from inside block comment delimiters.
     1735     *     @type array    $innerContent List of string fragments and null markers where
     1736     *                                  inner blocks were found.
     1737     * }
    16731738     * @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
    16741739     */
     
    16961761     *
    16971762     * @param array         $context      Default context.
    1698      * @param array         $parsed_block Block being rendered, filtered by `render_block_data`.
     1763     * @param array         $parsed_block {
     1764     *     A representative array of the block being rendered. See WP_Block_Parser_Block.
     1765     *
     1766     *     @type string   $blockName    Name of block.
     1767     *     @type array    $attrs        Attributes from block comment delimiters.
     1768     *     @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     1769     *                                  have the same structure as this one.
     1770     *     @type string   $innerHTML    HTML from inside block comment delimiters.
     1771     *     @type array    $innerContent List of string fragments and null markers where
     1772     *                                  inner blocks were found.
     1773     * }
    16991774     * @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
    17001775     */
     
    17121787 *
    17131788 * @param string $content Post content.
    1714  * @return array[] Array of parsed block objects.
     1789 * @return array[] {
     1790 *     Array of block structures.
     1791 *
     1792 *     @type array ...$0 {
     1793 *         A representative array of a single parsed block object. See WP_Block_Parser_Block.
     1794 *
     1795 *         @type string   $blockName    Name of block.
     1796 *         @type array    $attrs        Attributes from block comment delimiters.
     1797 *         @type array[]  $innerBlocks  List of inner blocks. An array of arrays that
     1798 *                                      have the same structure as this one.
     1799 *         @type string   $innerHTML    HTML from inside block comment delimiters.
     1800 *         @type array    $innerContent List of string fragments and null markers where
     1801 *                                      inner blocks were found.
     1802 *     }
     1803 * }
    17151804 */
    17161805function parse_blocks( $content ) {
Note: See TracChangeset for help on using the changeset viewer.