filtrod 5.1.0
pre_render_block
Opis — z kodu źródłowego
Allows render_block() to be short-circuited, by returning a non-null value.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$pre_render | string | null | The pre-rendered content. Default null. |
$parsed_block | array | { An associative array of the block being rendered. See WP_Block_Parser_Block. @type string|null $blockName Name of block. @type array $attrs Attributes from block comment delimiters. @type array[] $innerBlocks List of inner blocks. An array of arrays that have the same structure as this one. @type string $innerHTML HTML from inside block comment delimiters. @type array $innerContent List of string fragments and null markers where inner blocks were found. } |
$parent_block | \WP_Block | null | If this is a nested block, a reference to the parent block. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_render_block', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_render_block', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii