Whether the site is being previewed in the Customizer.
Source
function is_customize_preview() {
global $wp_customize;
return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
}
Changelog
Version | Description |
---|---|
4.0.0 | Introduced. |
Simple example to add something conditionally, if currently on customizer preview page: