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 Built from https://develop.svn.wordpress.org/trunk@60511 git-svn-id: http://core.svn.wordpress.org/trunk@59847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1676,13 +1676,13 @@ function get_comment_delimited_block_content( $block_name, $block_attributes, $b
|
||||
* @param array $block {
|
||||
* An associative array of a single parsed block object. See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @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.
|
||||
* @type string|null $blockName Name of block.
|
||||
* @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.
|
||||
* }
|
||||
* @return string String of rendered HTML.
|
||||
*/
|
||||
@@ -1717,13 +1717,13 @@ function serialize_block( $block ) {
|
||||
* @type array ...$0 {
|
||||
* An associative array of a single parsed block object. See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @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.
|
||||
* @type string|null $blockName Name of block.
|
||||
* @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.
|
||||
* }
|
||||
* }
|
||||
* @return string String of rendered HTML.
|
||||
@@ -2244,13 +2244,13 @@ function _excerpt_render_inner_blocks( $parsed_block, $allowed_blocks ) {
|
||||
* @param array $parsed_block {
|
||||
* An associative array of the block being rendered. See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @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.
|
||||
* @type string|null $blockName Name of block.
|
||||
* @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.
|
||||
* }
|
||||
* @return string String of rendered HTML.
|
||||
*/
|
||||
@@ -2268,13 +2268,13 @@ function render_block( $parsed_block ) {
|
||||
* @param array $parsed_block {
|
||||
* An associative array of the block being rendered. See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @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.
|
||||
* @type string|null $blockName Name of block.
|
||||
* @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.
|
||||
* }
|
||||
* @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
|
||||
*/
|
||||
@@ -2294,25 +2294,25 @@ function render_block( $parsed_block ) {
|
||||
* @param array $parsed_block {
|
||||
* An associative array of the block being rendered. See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @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.
|
||||
* @type string|null $blockName Name of block.
|
||||
* @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.
|
||||
* }
|
||||
* @param array $source_block {
|
||||
* An un-modified copy of `$parsed_block`, as it appeared in the source content.
|
||||
* See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @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.
|
||||
* @type string|null $blockName Name of block.
|
||||
* @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.
|
||||
* }
|
||||
* @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
|
||||
*/
|
||||
@@ -2342,13 +2342,13 @@ function render_block( $parsed_block ) {
|
||||
* @param array $parsed_block {
|
||||
* An associative array of the block being rendered. See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @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.
|
||||
* @type string|null $blockName Name of block.
|
||||
* @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.
|
||||
* }
|
||||
* @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
|
||||
*/
|
||||
@@ -2371,13 +2371,13 @@ function render_block( $parsed_block ) {
|
||||
* @type array ...$0 {
|
||||
* An associative array of a single parsed block object. See WP_Block_Parser_Block.
|
||||
*
|
||||
* @type string $blockName Name of block.
|
||||
* @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.
|
||||
* @type string|null $blockName Name of block.
|
||||
* @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.
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user