filtrod 4.9.6
theme_templates
Opis — z kodu źródłowego
Filters list of page templates for a theme.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$post_templates | string[] | Array of template header names keyed by the template file name. |
$theme | \WP_Theme | The theme object. |
$post | \WP_Post | null | The post being edited, provided for context, or null. |
$post_type | string | Post type to get the templates for. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'theme_templates', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'theme_templates', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii