restore_current_locale

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

WordPress Version: 6.2

/**
 * Restores the translations according to the original locale.
 *
 * @since 4.7.0
 *
 * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
 *
 * @return string|false Locale on success, false on error.
 */
function restore_current_locale()
{
    /* @var WP_Locale_Switcher $wp_locale_switcher */
    global $wp_locale_switcher;
    if (!$wp_locale_switcher) {
        return false;
    }
    return $wp_locale_switcher->restore_current_locale();
}

WordPress Version: 5.3

/**
 * Restores the translations according to the original locale.
 *
 * @since 4.7.0
 *
 * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
 *
 * @return string|false Locale on success, false on error.
 */
function restore_current_locale()
{
    /* @var WP_Locale_Switcher $wp_locale_switcher */
    global $wp_locale_switcher;
    return $wp_locale_switcher->restore_current_locale();
}

WordPress Version: 4.7

/**
 * Restores the translations according to the original locale.
 *
 * @since 4.7.0
 *
 * @global WP_Locale_Switcher $wp_locale_switcher
 *
 * @return string|false Locale on success, false on error.
 */
function restore_current_locale()
{
    /* @var WP_Locale_Switcher $wp_locale_switcher */
    global $wp_locale_switcher;
    return $wp_locale_switcher->restore_current_locale();
}