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.


Top ↑

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();
}


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.