WordPress at a glance

is_locale_switched() WP 1.0

Whether switch_to_locale() is in effect.

Notes:

  • 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.

Return

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

Usage

is_locale_switched();

Code of is_locale_switched: wp-includes/l10n.php VER 4.9.8

<?php
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 category: Localization

No comments
    Hello, !     Log In . Register