WP HOOKS
filtrdynamicznyod 6.5.0

hooked_block_{$hooked_block_type}

Args 5Plik wp-includes/blocks.php

Opis — z kodu źródłowego

Filters the parsed block array for a given hooked block.

The dynamic portion of the hook name, $hooked_block_type, refers to the block type name of the specific hooked block.

Parametry

ParametrTypOpis
$parsed_hooked_blockarray | nullThe parsed block array for the given hooked block type, or null to suppress the block.
$hooked_block_typestringThe hooked block type name.
$relative_positionstringThe relative position of the hooked block.
$parsed_anchor_blockarrayThe anchor block, in parsed block array format.
$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_{$hooked_block_type}', 'twoja_funkcja', 10, 5 );

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

Popularne w tej kategorii