is_customize_preview

函式
is_customize_preview ( No parameters )
返回值
  • (bool) True if the site is being previewed in the Customizer, false otherwise.
定義位置
相關方法
_set_previewwp_customize_urlis_preview_wp_customize_includepost_preview
引入
4.0.0
棄用
-

is_customize_preview: 如果當前頁面在定製器預覽中被檢視,這個WordPress函式返回真。自定義器是WordPress中的一個工具,它允許使用者自定義他們網站的外觀和功能,而不需要對程式碼進行修改。

網站是否在Customizer中被預覽。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function is_customize_preview() {
global $wp_customize;
return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
}
function is_customize_preview() { global $wp_customize; return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview(); }
function is_customize_preview() {
	global $wp_customize;

	return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
}

常見問題

FAQs
檢視更多 >