Fires after block assets have been enqueued for the editing interface.
Description
Call add_action on any hook before ‘admin_enqueue_scripts’.
In the function call you supply, simply use wp_enqueue_script and wp_enqueue_style to add your functionality to the block editor.
Source
do_action( 'enqueue_block_editor_assets' );
Changelog
| Version | Description |
|---|---|
| 5.0.0 | Introduced. |
Bug / undocumented feature:
If you are wondering why your styles are not added to the Full Site Editor, they will only be added if they contain a class starting with “.wp-block-” such as .wp-block-xyz, if no such class is detected, then the FSE will not load your file.
Note that this action is specifically for adding styles and scripts that impact the editor interface (e.g., the block sidebar or toolbar). For styling editor content, use
enqueue_block_assets.Background:
enqueue_block_assetsUsing this method you can enqueue JavaScript file for the editor
According to this:
https://github.com/WordPress/gutenberg/pull/48286#issuecomment-1673059007
This hook is only for adding scripts and styles for the editor UI. If you need scripts and styles for the editor content (the part in the iframe) and the front-end view, use enqueue_block_assets.