restore_current_locale() WordPress Function

restore_current_locale() is a function used in WordPress to restore the current locale. This function is useful for restoring the locale after it has been changed by a plugin or theme.

restore_current_locale() #

Restores the translations according to the original locale.


Return

(string|false) Locale on success, false on error.


Top ↑

Source

File: wp-includes/l10n.php

function restore_current_locale() {
	/* @var WP_Locale_Switcher $wp_locale_switcher */
	global $wp_locale_switcher;

	return $wp_locale_switcher->restore_current_locale();
}


Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.