restore_previous_locale
Fires when the locale is restored to the previous one.
Usage
add_action( 'restore_previous_locale', 'wp_kama_restore_previous_locale_action', 10, 2 ); /** * Function for `restore_previous_locale` action-hook. * * @param string $locale The new locale. * @param string $previous_locale The previous locale. * * @return void */ function wp_kama_restore_previous_locale_action( $locale, $previous_locale ){ // action... }
- $locale(string)
- The new locale.
- $previous_locale(string)
- The previous locale.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
restore_previous_locale
wp-includes/class-wp-locale-switcher.php 149
do_action( 'restore_previous_locale', $locale, $previous_locale[0] );