filtrod 5.9.0
pre_get_block_template
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
| Parametr | Typ | Opis |
|---|---|---|
$block_template | \WP_Block_Template | null | Return block template object to short-circuit the default query, or null to allow WP to run its normal queries. |
$id | string | Template unique identifier (example: 'theme_slug//template_slug'). |
$template_type | string | Template 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
}
// 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