is_locale_switched

The timeline below displays how wordpress function is_locale_switched has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Determines whether switch_to_locale() is in effect.
 *
 * @since 4.7.0
 *
 * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
 *
 * @return bool True if the locale has been switched, false otherwise.
 */
function is_locale_switched()
{
    /* @var WP_Locale_Switcher $wp_locale_switcher */
    global $wp_locale_switcher;
    return $wp_locale_switcher->is_switched();
}

WordPress Version: 5.3

/**
 * Whether switch_to_locale() is in effect.
 *
 * @since 4.7.0
 *
 * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
 *
 * @return bool True if the locale has been switched, false otherwise.
 */
function is_locale_switched()
{
    /* @var WP_Locale_Switcher $wp_locale_switcher */
    global $wp_locale_switcher;
    return $wp_locale_switcher->is_switched();
}

WordPress Version: 4.7

/**
 * Whether switch_to_locale() is in effect.
 *
 * @since 4.7.0
 *
 * @global WP_Locale_Switcher $wp_locale_switcher
 *
 * @return bool True if the locale has been switched, false otherwise.
 */
function is_locale_switched()
{
    /* @var WP_Locale_Switcher $wp_locale_switcher */
    global $wp_locale_switcher;
    return $wp_locale_switcher->is_switched();
}