Switches the translations according to the given user’s locale.
Parameters
$user_id
intrequired- User ID.
Source
*
* @return string|false Locale on success, false on error.
*/
function restore_previous_locale() {
/* @var WP_Locale_Switcher $wp_locale_switcher */
global $wp_locale_switcher;
if ( ! $wp_locale_switcher ) {
return false;
}
Changelog
Version | Description |
---|---|
6.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.