diff --git a/gutenberg.php b/gutenberg.php index d2eb01ecbd298..e6a0c32099d90 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -186,9 +186,41 @@ function register_site_icon_url( $response ) { * Registers the WP_Widget_Block widget */ function gutenberg_register_widgets() { - if ( gutenberg_is_experiment_enabled( 'gutenberg-widget-experiments' ) ) { - register_widget( 'WP_Widget_Block' ); + if ( ! gutenberg_is_experiment_enabled( 'gutenberg-widget-experiments' ) ) { + return; + } + + register_widget( 'WP_Widget_Block' ); + // By default every widget on widgets.php is wrapped with a
'; + } + + return $arg; +} + add_action( 'widgets_init', 'gutenberg_register_widgets' ); diff --git a/lib/widgets-page.php b/lib/widgets-page.php index 408dd217b6685..abf0a1cc540eb 100644 --- a/lib/widgets-page.php +++ b/lib/widgets-page.php @@ -39,6 +39,10 @@ function gutenberg_widgets_init( $hook ) { if ( 'widgets.php' === $hook ) { wp_enqueue_style( 'wp-block-library' ); wp_enqueue_style( 'wp-block-library-theme' ); + wp_add_inline_style( + 'wp-block-library-theme', + '.block-widget-form .widget-control-save { display: none; }' + ); return; } if ( ! in_array( $hook, array( 'gutenberg_page_gutenberg-widgets', 'gutenberg_customizer' ), true ) ) {