restore_previous_locale()
Restores the translations according to the previous locale.
No Hooks.
Returns
String|false
. Locale on success, false on error.
Usage
restore_previous_locale();
Notes
- Global. WP_Locale_Switcher. $wp_locale_switcher WordPress locale switcher object.
Changelog
Since 4.7.0 | Introduced. |
restore_previous_locale() restore previous locale code WP 6.8.1
function restore_previous_locale() { /* @var WP_Locale_Switcher $wp_locale_switcher */ global $wp_locale_switcher; if ( ! $wp_locale_switcher ) { return false; } return $wp_locale_switcher->restore_previous_locale(); }