Title: enqueue_block_editor_assets
Published: December 6, 2018
Last modified: August 20, 2026

---

# do_action( ‘enqueue_block_editor_assets’ )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#user-contributed-notes)

Fires after block assets have been enqueued for the editing interface.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#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](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#source)󠁿

    ```php
    do_action( 'enqueue_block_editor_assets' );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/edit-form-blocks.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/edit-form-blocks.php#L357)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/edit-form-blocks.php#L357-L357)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Customize_Widgets::enqueue_scripts()](https://developer.wordpress.org/reference/classes/wp_customize_widgets/enqueue_scripts/)`wp-includes/class-wp-customize-widgets.php` |

Enqueues scripts and styles for Customizer panel and export data to JavaScript.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 5 content](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#comment-content-6139)
 2.    [Stiofan](https://profiles.wordpress.org/stiofansisland/)  [  4 years ago  ](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/#comment-6139)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%23comment-6139)
     Vote results for this note: 10[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%23comment-6139)
 4.  Bug / undocumented feature:
 5.  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.
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%3Freplytocom%3D6139%23feedback-editor-6139)
 7.   [Skip to note 6 content](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#comment-content-6842)
 8.    [mrwweb](https://profiles.wordpress.org/mrwweb/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/#comment-6842)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%23comment-6842)
     Vote results for this note: 3[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%23comment-6842)
 10. 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`](https://developer.wordpress.org/reference/hooks/enqueue_block_assets/).
 11. Background:
 12.  * [Announcement of `enqueue_block_assets`](https://make.wordpress.org/core/2023/07/18/miscellaneous-editor-changes-in-wordpress-6-3/#post-editor-iframed)
      * [“Enqueueing Editor Scripts and Styles”](https://developer.wordpress.org/block-editor/how-to-guides/enqueueing-assets-in-the-editor/#editor-content-scripts-and-styles)
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%3Freplytocom%3D6842%23feedback-editor-6842)
 14.  [Skip to note 7 content](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#comment-content-7196)
 15.   [leemon](https://profiles.wordpress.org/leemon/)  [  2 years ago  ](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/#comment-7196)
 16. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%23comment-7196)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%23comment-7196)
 17. According to this:
 18. [https://github.com/WordPress/gutenberg/pull/48286#issuecomment-1673059007](https://github.com/WordPress/gutenberg/pull/48286#issuecomment-1673059007)
 19. 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](https://developer.wordpress.org/reference/hooks/enqueue_block_assets/).
 20.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%3Freplytocom%3D7196%23feedback-editor-7196)
 21.  [Skip to note 8 content](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/?output_format=md#comment-content-5647)
 22.   [Jaydip](https://profiles.wordpress.org/iamjaydip/)  [  5 years ago  ](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/#comment-5647)
 23. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%23comment-5647)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%23comment-5647)
 24. Using this method you can enqueue JavaScript file for the editor
 25.     ```php
         function wpdocs_enqueue_scripts() {
     
           $blockPath = '/blocks/index.js';
     
           // Enqueue the block index.js file
           wp_enqueue_script(
             'example-block', // unique handle
             get_template_directory_uri() . $blockPath,
             [ 'wp-blocks', 'wp-element', 'wp-i18n' ], // required dependencies for blocks
             filemtime( get_template_directory() . $blockPath )
           );
     
         }
         add_action( 'enqueue_block_editor_assets', 'wpdocs_enqueue_scripts' );
         ```
     
 26.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F%3Freplytocom%3D5647%23feedback-editor-5647)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenqueue_block_editor_assets%2F)
before being able to contribute a note or feedback.