akcjaod 5.2.0
get_template_part
Opis — z kodu źródłowego
Fires before an attempt is made to locate and load a template part.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$slug | string | The slug name for the generic template. |
$name | string | The name of the specialized template or an empty string if there is none. |
$templates | string[] | Array of template files to search for, in order. |
$args | array | Additional arguments passed to the template. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'get_template_part', '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_action( 'get_template_part', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii