switch_to_locale

函数


switch_to_locale ( $locale )
参数
  • (string)
    $locale
    The locale.
    Required:
返回值
  • (bool) True on success, false on failure.
定义位置
  • wp-includes/l10n.php
    , line 1663
引入
4.7.0
弃用

Switches the translations according to the given locale.

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

	return $wp_locale_switcher->switch_to_locale( $locale );
}