enqueue_block_assets
Action HookDescription
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.Hook Information
File Location |
wp-includes/script-loader.php
View on GitHub
|
Hook Type | Action |
Line Number | 2483 |
Hook Parameters
This hook doesn't accept any parameters.
Usage Examples
Basic Usage
<?php
// Hook into enqueue_block_assets
add_action('enqueue_block_assets', 'my_custom_function');
function my_custom_function() {
// Your custom code here
}
Source Code Context
wp-includes/script-loader.php:2483
- How this hook is used in WordPress core
<?php
2478 * In the function call you supply, simply use `wp_enqueue_script` and
2479 * `wp_enqueue_style` to add your functionality to the Gutenberg editor.
2480 *
2481 * @since 5.0.0
2482 */
2483 do_action( 'enqueue_block_assets' );
2484 }
2485
2486 /**
2487 * Applies a filter to the list of style nodes that comes from WP_Theme_JSON::get_style_nodes().
2488 *
PHP Documentation
<?php
/**
* 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.
*
* @since 5.0.0
*/
Quick Info
- Hook Type: Action
- Parameters: 0
- File: wp-includes/script-loader.php
Related Hooks
Related hooks will be displayed here in future updates.