WP HOOKS
filtrod 5.9.0

get_block_file_template

Args 3Plik wp-includes/block-template-utils.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the block template object after it has been (potentially) fetched from the theme file.

Parametry

ParametrTypOpis
$block_template\WP_Block_Template | nullThe found block template, or null if there is none.
$idstringTemplate unique identifier (example: 'theme_slug//template_slug').
$template_typestringTemplate type. Either 'wp_template' or 'wp_template_part'.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'get_block_file_template', 'twoja_funkcja', 10, 3 );

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

Popularne w tej kategorii