WP_Customize_Manager::is_preview PHP Method

is_preview() public method

Is it a theme preview?
Since: 3.4.0
public is_preview ( ) : boolean
return boolean True if it's a preview, false if not.
    public function is_preview()
    {
        return (bool) $this->previewing;
    }

Usage Example

 public function ajax_customizer_reset()
 {
     if (!$this->wp_customize->is_preview()) {
         wp_send_json_error('not_preview');
     }
     if (!check_ajax_referer('customizer-reset', 'nonce', false)) {
         wp_send_json_error('invalid_nonce');
     }
     $this->reset_customizer();
     wp_send_json_success();
 }
All Usage Examples Of WP_Customize_Manager::is_preview
WP_Customize_Manager