diff --git a/src/wp-admin/widgets-form-blocks.php b/src/wp-admin/widgets-form-blocks.php index 6921ff7a15..7f3b6b2f65 100644 --- a/src/wp-admin/widgets-form-blocks.php +++ b/src/wp-admin/widgets-form-blocks.php @@ -29,6 +29,11 @@ $editor_settings = get_block_editor_settings( $block_editor_context ); +// The widgets editor does not support the Block Directory, so don't load any of +// its assets. This also prevents 'wp-editor' from being enqueued which we +// cannot load in the widgets screen because many widget scripts rely on `wp.editor`. +remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); + wp_add_inline_script( 'wp-edit-widgets', sprintf( @@ -67,7 +72,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; do_action( 'widgets_admin_page' ); ?> -
+