WP HOOKS
akcjadynamicznyod 3.0.0

get_template_part_{$slug}

Args 3Plik wp-includes/general-template.php

Opis — z kodu źródłowego

Fires before the specified template part file is loaded.

The dynamic portion of the hook name, $slug, refers to the slug name for the generic template part.

Parametry

ParametrTypOpis
$slugstringThe slug name for the generic template.
$namestring | nullThe name of the specialized template or null if there is none.
$argsarrayAdditional arguments passed to the template.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'get_template_part_{$slug}', 'twoja_funkcja', 10, 3 );

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

Popularne w tej kategorii