W3cubDocs

/WordPress

apply_filters( ‘render_block_data’, array $parsed_block, array $source_block, WP_Block|null $parent_block )

Filters the block being rendered in render_block() , before it’s processed.

Parameters

$parsed_blockarray
An associative array of the block being rendered. See WP_Block_Parser_Block.
  • blockName string
    Name of block.
  • attrs array
    Attributes from block comment delimiters.
  • innerBlocks array[]
    List of inner blocks. An array of arrays that have the same structure as this one.
  • innerHTML string
    HTML from inside block comment delimiters.
  • innerContent array
    List of string fragments and null markers where inner blocks were found.
$source_blockarray
An un-modified copy of $parsed_block, as it appeared in the source content.
See WP_Block_Parser_Block.
  • blockName string
    Name of block.
  • attrs array
    Attributes from block comment delimiters.
  • innerBlocks array[]
    List of inner blocks. An array of arrays that have the same structure as this one.
  • innerHTML string
    HTML from inside block comment delimiters.
  • innerContent array
    List of string fragments and null markers where inner blocks were found.
$parent_blockWP_Block|null
If this is a nested block, a reference to the parent block.

Source

$parsed_block = apply_filters( 'render_block_data', $parsed_block, $source_block, $parent_block );

Changelog

Version Description
5.9.0 The $parent_block parameter was added.
5.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/render_block_data