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.
Usage
add_action( 'enqueue_block_assets', 'wp_kama_enqueue_block_assets_action' ); /** * Function for `enqueue_block_assets` action-hook. * * @return void */ function wp_kama_enqueue_block_assets_action(){ // action... }
Changelog
Since 5.0.0 | Introduced. |
Where the hook is called
enqueue_block_assets
enqueue_block_assets
wp-includes/script-loader.php 2447
do_action( 'enqueue_block_assets' );
wp-includes/block-editor.php 340
do_action( 'enqueue_block_assets' );
Where the hook is used in WordPress
wp-includes/default-filters.php 573
add_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
wp-includes/default-filters.php 574
add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
wp-includes/script-loader.php 3295
add_action( 'enqueue_block_assets', $callback );