filtrod 5.9.0
get_block_templates
Opis — z kodu źródłowego
Filters the array of queried block templates array after they've been fetched.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$query_result | \WP_Block_Template[] | Array of found block templates. |
$query | array | { Arguments to retrieve templates. All arguments are optional. @type string[] $slug__in List of slugs to include. @type int $wp_id Post ID of customized template. @type string $area A 'wp_template_part_area' taxonomy value to filter by (for 'wp_template_part' template type only). @type string $post_type Post type to get the templates for. } |
$template_type | string | wp_template or wp_template_part. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'get_block_templates', '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( 'get_block_templates', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii