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

Filters the content of a single block.


Description Description

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


Top ↑

Parameters Parameters

$block_content

(string) The block content about to be appended.

$block

(array) The full block, including name and attributes.


Top ↑

Source Source

File: wp-includes/class-wp-block.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
5.7.0 Introduced.

Top ↑

User Contributed Notes 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.