render_block_data WordPress Filter Hook

The render_block_data hook is used to modify the data that is used to render a block. This hook is called before a block is rendered, and allows you to modify the data that is used to render the block. This can be used to add or remove data from the data that is used to render the block.

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_block

(array)The block being rendered.

$source_block

(array)An un-modified copy of $parsed_block, as it appeared in the source content.

$parent_block

(WP_Block|null)If this is a nested block, a reference to the parent block.


Top ↑

Source

File: wp-includes/blocks.php

View on Trac



Top ↑

Changelog

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

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.