WP HOOKS
filtrod 5.9.0

pre_get_block_template

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

Opis — z kodu źródłowego

Filters the block template object before the query takes place.

Return a non-null value to bypass the WordPress queries.

Parametry

ParametrTypOpis
$block_template\WP_Block_Template | nullReturn block template object to short-circuit the default query, or null to allow WP to run its normal queries.
$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( 'pre_get_block_template', 'twoja_funkcja', 10, 3 );

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

Popularne w tej kategorii