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 );