restore_previous_locale

函式
restore_previous_locale ( No parameters )
返回值
  • (string|false) Locale on success, false on error.
定義位置
相關方法
restore_current_localeget_previous_postwp_restore_post_revisionrest_api_loadedget_user_locale
引入
4.7.0
棄用
-

restore_previous_locale: 這是一個WordPress的函式,在暫時切換到一個不同的locale後,恢復以前的locale: 當你想在臨時切換到一個新的locale後再切換回以前的locale時,這個函式很有用。

根據先前的locale來恢復翻譯。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function restore_previous_locale() {
/* @var WP_Locale_Switcher $wp_locale_switcher */
global $wp_locale_switcher;
return $wp_locale_switcher->restore_previous_locale();
}
function restore_previous_locale() { /* @var WP_Locale_Switcher $wp_locale_switcher */ global $wp_locale_switcher; return $wp_locale_switcher->restore_previous_locale(); }
function restore_previous_locale() {
	/* @var WP_Locale_Switcher $wp_locale_switcher */
	global $wp_locale_switcher;

	return $wp_locale_switcher->restore_previous_locale();
}

常見問題

FAQs
檢視更多 >