change_locale

ACTION wp-includes\class-wp-locale-switcher.php (ligne 300) github
Fires when the locale is switched to or restored.

Paramètres

Entrée :
$locale
Sortie :
@param string $locale The new locale.

Utilisation

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

function ma_fonction_personnalisee($locale) {
    // Votre code ici
    error_log('Hook change_locale déclenché');
}

Actualités

Chargement des actualités...