is_customize_preview

函数


is_customize_preview ( No parameters )
返回值
  • (bool) True if the site is being previewed in the Customizer, false otherwise.
定义位置
  • wp-includes/theme.php
    , line 3717
引入
4.0.0
弃用

网站是否在Customizer中被预览。

function is_customize_preview() {
	global $wp_customize;

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