From 0d49b5596bdaa75a548a5f52772fc5b7fabce139 Mon Sep 17 00:00:00 2001 From: Nikita Sinelnikov Date: Tue, 20 Jul 2021 15:53:32 +0300 Subject: [PATCH] - fixed no preview available block displaying; --- includes/widgets/class-um-search-widget.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/widgets/class-um-search-widget.php b/includes/widgets/class-um-search-widget.php index 6c429757..a1d29719 100644 --- a/includes/widgets/class-um-search-widget.php +++ b/includes/widgets/class-um-search-widget.php @@ -40,6 +40,13 @@ class UM_Search_Widget extends \WP_Widget { * @param array $instance */ public function widget( $args, $instance ) { + if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { + return; + } + + if ( ! empty( $_GET['legacy-widget-preview'] ) && defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST ) { + return; + } $title = array_key_exists( 'title', $instance ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title );