apply_filters( "render_block_{$this->name}", string $block_content, array $block, WP_Block $instance )

Filters the content of a single block.


Description

The dynamic portion of the hook name, $name, refers to the block name, e.g. "core/paragraph".


Top ↑

Parameters

$block_content string
The block content.
$block array
The full block, including name and attributes.
$instance WP_Block
The block instance.

Top ↑

Source

File: wp-includes/class-wp-block.php. View all references

$block_content = apply_filters( "render_block_{$this->name}", $block_content, $this->parsed_block, $this );


Top ↑

Changelog

Changelog
Version Description
5.9.0 The $instance parameter was added.
5.7.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by Lovro Hrust

    $block is array with keys:

    • blockName
    • attrs – array of block attributes
    • innerBlocks – array of inner blocks
    • innerHTML – resultant HTML from inside block comment delimiters after removing inner blocks.
    • innerContent – list of string fragments and null markers where inner blocks were found

    These keys are explained and referenced in WP_Block

You must log in before being able to contribute a note or feedback.