Filter hook 'render_block_context'

in WP Core File wp-includes/class-wp-block.php at line 554

View Source

render_block_context

Filter Hook
Description
Filters whether Interactivity API should process directives.

Hook Information

File Location wp-includes/class-wp-block.php View on GitHub
Hook Type Filter
Line Number 554

Hook Parameters

Type Name Description
bool $enabled Whether the directives processing is enabled.

Usage Examples

Basic Usage
<?php
// Hook into render_block_context
add_filter('render_block_context', 'my_custom_filter', 10, 1);

function my_custom_filter($enabled) {
    // Your custom filtering logic here
    return $enabled;
}

Source Code Context

wp-includes/class-wp-block.php:554 - How this hook is used in WordPress core
<?php
 549  
 550  						/** This filter is documented in wp-includes/blocks.php */
 551  						$inner_block->parsed_block = apply_filters( 'render_block_data', $inner_block->parsed_block, $source_block, $parent_block );
 552  
 553  						/** This filter is documented in wp-includes/blocks.php */
 554  						$inner_block->context = apply_filters( 'render_block_context', $inner_block->context, $inner_block->parsed_block, $parent_block );
 555  
 556  						/*
 557  						 * The `refresh_context_dependents()` method already calls `refresh_parsed_block_dependents()`.
 558  						 * Therefore the second condition is irrelevant if the first one is satisfied.
 559  						 */

PHP Documentation

<?php
/**
		 * Filters whether Interactivity API should process directives.
		 *
		 * @since 6.6.0
		 *
		 * @param bool $enabled Whether the directives processing is enabled.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/class-wp-block.php
Related Hooks

Related hooks will be displayed here in future updates.