diff --git a/gutenberg.php b/gutenberg.php index e6a0c32099d90..6c5a1966a0b5c 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -191,36 +191,6 @@ function gutenberg_register_widgets() { } register_widget( 'WP_Widget_Block' ); - // By default every widget on widgets.php is wrapped with a
. - // This means that you can sometimes end up with invalid HTML, e.g. when - // one of the widgets is a Search block. - // - // To fix the problem, let's add a filter that moves the form below the actual - // widget content. - global $pagenow; - if ( 'widgets.php' === $pagenow ) { - add_filter( - 'dynamic_sidebar_params', - 'gutenberg_override_sidebar_params_for_block_widget' - ); - } -} - -/** - * Overrides dynamic_sidebar_params to make sure Blocks are not wrapped in tag. - * - * @param array $arg Dynamic sidebar params. - * @return array Updated dynamic sidebar params. - */ -function gutenberg_override_sidebar_params_for_block_widget( $arg ) { - if ( 'Block' === $arg[0]['widget_name'] ) { - $arg[0]['before_form'] = ''; - $arg[0]['before_widget_content'] = '
'; - $arg[0]['after_widget_content'] = '
'; - $arg[0]['after_form'] = '
'; - } - - return $arg; } add_action( 'widgets_init', 'gutenberg_register_widgets' ); diff --git a/lib/class-wp-widget-block.php b/lib/class-wp-widget-block.php index a9eb407abddc4..f1ca4b3c034fd 100644 --- a/lib/class-wp-widget-block.php +++ b/lib/class-wp-widget-block.php @@ -80,9 +80,8 @@ public function update( $new_instance, $old_instance ) { */ public function form( $instance ) { $instance = wp_parse_args( (array) $instance, $this->default_instance ); - echo do_blocks( $instance['content'] ); ?> - +