is_locale_switched() WordPress Function
The is_locale_switched() function is used to check whether the current locale has been switched. This function is useful for plugin and theme developers who need to know whether the current locale has been changed by the user.
is_locale_switched() #
Whether switch_to_locale() is in effect.
Return
(bool) True if the locale has been switched, false otherwise.
Source
File: wp-includes/l10n.php
function is_locale_switched() { /* @var WP_Locale_Switcher $wp_locale_switcher */ global $wp_locale_switcher; return $wp_locale_switcher->is_switched(); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |