WordPress开发者和主题制作者的搜索引擎



switch_to_locale ›

Since4.7.0
已弃用n/a
switch_to_locale ( $locale )
参数:
  • (string) $locale The locale.
    Required: Yes
返回:
  • (bool) True on success, false on failure.
定义在:
文档:

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