do_action( 'enqueue_block_assets' )

Fires after enqueuing block assets for both editor and front-end.


Call add_action on any hook before ‘wp_enqueue_scripts’.

In the function call you supply, simply use wp_enqueue_script and wp_enqueue_style to add your functionality to the Gutenberg editor.

Top ↑


File: wp-includes/script-loader.php. View all references

do_action( 'enqueue_block_assets' );

Top ↑


Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    function wpdocs_mytheme_block_styles() {
        wp_enqueue_style( 'testimonial',  get_stylesheet_directory_uri() . '/template-parts/blocks/testimonial/testimonial.css' );
        wp_enqueue_script( 'testimonial',  get_stylesheet_directory_uri() . '/template-parts/blocks/testimonial/testimonial.js' );
    add_action( 'enqueue_block_assets', 'wpdocs_mytheme_block_styles' );

You must log in before being able to contribute a note or feedback.