WP HOOKS
filtrdynamicznyod 5.7.0

render_block_{$this->name}

Args 3Plik wp-includes/class-wp-block.php

Opis — z kodu źródłowego

Filters the content of a single block.

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

Parametry

ParametrTypOpis
$block_contentstringThe block content.
$blockarrayThe full block, including name and attributes.
$instance\WP_BlockThe block instance.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'render_block_{$this->name}', 'twoja_funkcja', 10, 3 );

function twoja_funkcja($param_1, $param_2, $param_3) {
	// Twój kod
}

Popularne w tej kategorii