switch_locale
Fires when the locale is switched.
Usage
add_action( 'switch_locale', 'wp_kama_switch_locale_action' ); /** * Function for `switch_locale` action-hook. * * @param string $locale The new locale. * * @return void */ function wp_kama_switch_locale_action( $locale ){ // action... }
- $locale(string)
- The new locale.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
switch_locale
wp-includes/class-wp-locale-switcher.php 92
do_action( 'switch_locale', $locale );