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.
$slug, $name, $args
Sortie :
@param string $slug The slug name for the generic template. @param string|null $name The name of the specialized template @param array $args Additional arguments passed to the template.
// Ajouter une fonction au hook action 'get_template_part_{$slug}'
add_action('get_template_part_{$slug}', 'ma_fonction_personnalisee', 10, 1);
function ma_fonction_personnalisee($slug, $name, $args) {
// Votre code ici
error_log('Hook get_template_part_{$slug} déclenché');
}
Chargement des actualités...