render_block_data
Filters the block being rendered in render_block(), before it's processed.
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
wp-includes/blocks.php 1454
$parsed_block = apply_filters( 'render_block_data', $parsed_block, $source_block, $parent_block );
wp-includes/class-wp-block.php 239
$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 261
add_filter( 'render_block_data', 'block_core_latest_posts_migrate_categories' );
wp-includes/blocks/navigation.php 830
add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_backcompatibility' );
wp-includes/blocks/query.php 214
add_filter( 'render_block_data', 'block_core_query_disable_enhanced_pagination', 10, 1 );