filtrod 6.4.0
hooked_block_types
Opis — z kodu źródłowego
Filters the list of hooked block types for a given anchor block type and relative position.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$hooked_block_types | string[] | The list of hooked block types. |
$relative_position | string | The relative position of the hooked blocks. Can be one of 'before', 'after', 'first_child', or 'last_child'. |
$anchor_block_type | string | The anchor block type. |
$context | \WP_Block_Template | \WP_Post | array | The block template, template part, post object, or pattern that the anchor block belongs to. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'hooked_block_types', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'hooked_block_types', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii