render_block_data filter-hookWP 5.1.0

Usage

add_filter( 'render_block_data', 'wp_kama_render_block_data_filter', 10, 3 );

/**
 * Function for `render_block_data` filter-hook.
 * 
 * @param array         $parsed_block The block being rendered.
 * @param array         $source_block An un-modified copy of $parsed_block, as it appeared in the source content.
 * @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
 *
 * @return array
 */
function wp_kama_render_block_data_filter( $parsed_block, $source_block, $parent_block ){

	// filter...
	return $parsed_block;
}
$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.

Changelog

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

Where the hook is called

render_block()
render_block_data
WP_Block::render()
render_block_data
wp-includes/blocks.php 871
$parsed_block = apply_filters( 'render_block_data', $parsed_block, $source_block, $parent_block );
wp-includes/class-wp-block.php 236
$inner_block->parsed_block = apply_filters( 'render_block_data', $inner_block->parsed_block, $source_block, $parent_block );

Where the hook is used in WordPress

wp-includes/blocks/gallery.php 33
add_filter( 'render_block_data', 'block_core_gallery_data_id_backcompatibility' );
wp-includes/blocks/latest-posts.php 245
add_filter( 'render_block_data', 'block_core_latest_posts_migrate_categories' );
wp-includes/blocks/navigation.php 690
add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_backcompatibility' );