apply_filters( ‘pre_render_block’, string|null $pre_render, array $parsed_block, WP_Block|null $parent_block )

In this article

Allows render_block() to be short-circuited, by returning a non-null value.

Parameters

$pre_renderstring|null
The pre-rendered content. Default null.
$parsed_blockarray
A representative 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.
$parent_blockWP_Block|null
If this is a nested block, a reference to the parent block.

Source

$pre_render = apply_filters( 'pre_render_block', null, $parsed_block, $parent_block );

Changelog

VersionDescription
5.9.0The $parent_block parameter was added.
5.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.