WordPress filter hook · part of WordPress core
pre_render_block
A WordPress core filter that 10 plugins also fire themselves, running on 51K+ sites between them.
“This filter is documented in wp-includes/blocks.php”
How to use pre_render_block
It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'pre_render_block', function( $value, $parsed_block, $parent_block ) {
// Change $value here.
return $value;
}, 10, 3 );Argument names come from News Element's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
10 plugins that fire pre_render_block
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Gallery by Visual Portfolio50,000+ installs
apply_filters( 'pre_render_block', null, $item, $block )gutenberg/blocks/loop-filter/index.php:274 -
GRO300+ installs
apply_filters( 'pre_render_block', null, $inner->parsed_block, $parent )includes/Blocks/ContentGateBlock.php:601 -
News Element200+ installs
apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $parent_block )controls/modules/nested-elements/includes/class-nested-block-base.php:182 -
MindCat100+ installs
apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $block_class )inc/class-mindcat.php:290 -
Etchenet Scroll Video Background Builder20+ installs
apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $block )includes/class-block.php:225 -
PDF Invoice Builder for WooCommerceFewer than 10 installs
apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $parent_block )lib/block-controls/modules/nested-elements/includes/class-nested-block-base.php:182 -
FieldwrenFewer than 10 installs
apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $parent_block )lib/block-controls/modules/nested-elements/includes/class-nested-block-base.php:182 -
Email CustomizerFewer than 10 installs
apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $parent_block )lib/block-controls/modules/nested-elements/includes/class-nested-block-base.php:182 -
Gutenberg Login Page CustomizerFewer than 10 installs
apply_filters( 'pre_render_block', null, $inner_block->parsed_block, $parent_block )block-controls/nested/class-nested-block-base.php:182 -
Flexify Blocks & Addons for GutenbergFewer than 10 installs
apply_filters( 'pre_render_block', null, $inner->parsed_block, $block )build/blocks/query-loop/render.php:53
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.