WordPress at a glance

is_locale_switched() WP 1.0

Whether switch_to_locale() is in effect.

  • Global. WP_Locale_Switcher. $wp_locale_switcher
✈ 1 time = 0.000019s = very fast | 50000 times = 0.02s = speed of light | PHP 7.0.14, WP 4.7

No Hooks.


true/false. True if the locale has been switched, false otherwise.



Code of is locale switched: wp-includes/l10n.php WP 5.2.2

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

	return $wp_locale_switcher->is_switched();

Related Functions

From tag: locale (site language)

More from tag: localize (l10n i18n Internationalization localization)

More from category: Localization

No comments
    Hello, !     Log In . Register