#50661 closed defect (bug) (fixed)
Block Editor: Missing styles for block directory
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | 5.5 |
Component: | Editor | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
It looks like the styles for the block directory aren't being loaded in the editor. They're correctly bundled into the dist file, but never enqueued.
Attachments (1)
Change History (11)
This ticket was mentioned in PR #406 on WordPress/wordpress-develop by ryelle.
5 years ago
#2
- Keywords has-patch added
This adds the block directory styles as a dependency of the edit-post
style.
Fixed screenshot:

Trac ticket: https://core.trac.wordpress.org/ticket/50661
TimothyBJacobs commented on PR #406:
5 years ago
#3
Do we need to remove the manual enqueues from edit-form-blocks.php
.
5 years ago
#4
What's the reason for enqueueing in that file, instead of setting up dependencies in script-loader? If I were to follow the JS, I'd remove the dependency here, but I'm not sure which is the preferred method.
TimothyBJacobs commented on PR #406:
5 years ago
#5
I'm not sure. Maybe @tellyworth knows?
tellyworth commented on PR #406:
5 years ago
#6
It was just a silly oversight on my part while backporting, it wasn't intentional.
5 years ago
#7
I've moved the enqueue calls to new function, wp_enqueue_block_editor_assets_block_directory
, hooked into enqueue_block_editor_assets
, so script & style are both added together now.
This also provides a method for disabling the block directory, by unhooking that function:
{{{php
add_action(
'plugins_loaded',
function() {
remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_block_editor_assets_block_directory' );
}
);
}}}
5 years ago
#10
This was committed in https://core.trac.wordpress.org/changeset/48537. For reference, I went with a different function name, wp_enqueue_editor_block_directory_assets()
. It read a bit more clear to me.
screenshot of current block directory result, missing styles