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