is_customize_preview
Whether the site is being previewed in the Customizer.
Description
is_customize_preview();
Usage
if ( !function_exists( 'is_customize_preview' ) ) { require_once ABSPATH . WPINC . '/theme.php'; } // NOTICE! Understand what this does before running. $result = is_customize_preview();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/theme.php
- function is_customize_preview() {
- global $wp_customize;
- return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
- }