WP_Widget::is_preview() – Determines whether the current request is inside the Customizer preview.
You appear to be a bot. Output may be restricted
Description
Determines whether the current request is inside the Customizer preview.
If true — the current request is inside the Customizer preview, then the object cache gets suspended and widgets should check this to decide whether they should store anything persistently to the object cache, to transients, or anywhere else.
Usage
$bool = WP_Widget::is_preview();
Parameters
Returns
bool True if within the Customizer preview, false if not.
Source
File name: wordpress/wp-includes/class-wp-widget.php
Lines:
1 to 4 of 4
public function is_preview() { global $wp_customize; return ( isset( $wp_customize ) && $wp_customize->WP_Widget::is_preview() ); }