pre_render_block WordPress Filter Hook
The pre_render_block hook is called before a block is rendered. It allows you to modify the block before it is rendered. This can be useful for adding dynamic content to a block, or for modifying the output of a block.
apply_filters( 'pre_render_block', string|null $pre_render , array $parsed_block , WP_Block|null $parent_block ) #
Allows render_block() to be short-circuited, by returning a non-null value.
Parameters
- $pre_render
(string|null)The pre-rendered content. Default null.
- $parsed_block
(array)The block being rendered.
- $parent_block
(WP_Block|null)If this is a nested block, a reference to the parent block.
Source
File: wp-includes/blocks.php
Changelog
Version | Description |
---|---|
5.9.0 | The $parent_block parameter was added. |
5.1.0 | Introduced. |