WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Widget::is_preview() public WP 3.9.0

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.

Это метод класса: WP_Widget{}

Хуков нет.

Возвращает

true/false. True if within the Customizer preview, false if not.

Использование

$WP_Widget = new WP_Widget();
$WP_Widget->is_preview();

Заметки

  • Global. WP_Customize_Manager. $wp_customize

Список изменений

С версии 3.9.0 Введена.

Код WP_Widget::is_preview() WP 5.5.1

wp-includes/class-wp-widget.php
<?php
public function is_preview() {
	global $wp_customize;
	return ( isset( $wp_customize ) && $wp_customize->is_preview() );
}