filtrod 5.5.0
render_block_context
Opis — z kodu źródłowego
Filters the default context provided to a rendered block.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$context | array | Default context. |
$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( 'render_block_context', '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( 'render_block_context', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii