WP HOOKS
filtrod 6.4.0

hooked_block_types

Args 4Plik wp-includes/blocks.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the list of hooked block types for a given anchor block type and relative position.

Parametry

ParametrTypOpis
$hooked_block_typesstring[]The list of hooked block types.
$relative_positionstringThe relative position of the hooked blocks. Can be one of 'before', 'after', 'first_child', or 'last_child'.
$anchor_block_typestringThe anchor block type.
$context\WP_Block_Template | \WP_Post | arrayThe 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
}

Popularne w tej kategorii