render_block_{$this->name}
Filter HookDescription
Filters the content of a single block. The dynamic portion of the hook name, `$name`, refers to the block name, e.g. "core/paragraph".Hook Information
File Location |
wp-includes/class-wp-block.php
View on GitHub
|
Hook Type | Filter |
Line Number | 653 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$block_content
|
The block content. |
array
|
$block
|
The full block, including name and attributes. |
WP_Block
|
$instance
|
The block instance. |
Usage Examples
Basic Usage
<?php
// Hook into render_block_{$this->name}
add_filter('render_block_{$this->name}', 'my_custom_filter', 10, 3);
function my_custom_filter($block_content, $block, $instance) {
// Your custom filtering logic here
return $block_content;
}
Source Code Context
wp-includes/class-wp-block.php:653
- How this hook is used in WordPress core
<?php
648 *
649 * @param string $block_content The block content.
650 * @param array $block The full block, including name and attributes.
651 * @param WP_Block $instance The block instance.
652 */
653 $block_content = apply_filters( "render_block_{$this->name}", $block_content, $this->parsed_block, $this );
654
655 if ( $root_interactive_block === $this ) {
656 // The root interactive block has finished rendering. Time to process directives.
657 $block_content = wp_interactivity_process_directives( $block_content );
658 $root_interactive_block = null;
PHP Documentation
<?php
/**
* Filters the content of a single block.
*
* The dynamic portion of the hook name, `$name`, refers to
* the block name, e.g. "core/paragraph".
*
* @since 5.7.0
* @since 5.9.0 The `$instance` parameter was added.
*
* @param string $block_content The block content.
* @param array $block The full block, including name and attributes.
* @param WP_Block $instance The block instance.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/class-wp-block.php
Related Hooks
Related hooks will be displayed here in future updates.