wp_before_load_template

ACTION wp-includes\template.php (ligne 811) github
Fires before a template file is loaded.

Paramètres

Entrée :
$_template_file, $load_once, $args
Sortie :
@param string $_template_file The full path to the template file.
@param bool   $load_once      Whether to require_once or require.
@param array  $args           Additional arguments passed to the template.

Utilisation

// Ajouter une fonction au hook action 'wp_before_load_template'
add_action('wp_before_load_template', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($_template_file, $load_once, $args) {
    // Votre code ici
    error_log('Hook wp_before_load_template déclenché');
}

Actualités

Chargement des actualités...