render_block_(name) filter-hook . WP 5.7.0
Filters the content of a single block.
The dynamic portion of the hook name, $name, refers to the block name, e.g. "core/paragraph".
Usage
add_filter( 'render_block_(name)', 'filter_function_name_3793', 10, 2 ); function filter_function_name_3793( $block_content, $block ){ // filter... return $block_content; }
- $block_content(string)
- The block content about to be appended.
- $block(array)
- The full block, including name and attributes.
Changelog
Since 5.7.0 | Introduced. |
Where the hook is called
render_block_(name)
wp-includes/class-wp-block.php 257
$block_content = apply_filters( "render_block_{$this->name}", $block_content, $this->parsed_block );
Where in WP core the hook is used WordPress
wp-includes/blocks/latest-posts.php 225
add_filter( 'render_block_data', 'block_core_latest_posts_migrate_categories' );