是否在Customizer中预览网站。
原型
is_customize_preview()
返回值
(bool)
如果在定制程序中预览网站,则为True,否则为false。
源文件
路径:wp-includes/theme.php
<?php
...
function is_customize_preview() {
global $wp_customize;
return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/is_customize_preview/