Skip to content

Commit

Permalink
Enqueue assets in a way that works for edit-site
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Feb 11, 2020
1 parent 39ab546 commit cac0947
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/global-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ function gutenberg_experimental_global_styles_register_cpt() {
add_action( 'init', 'gutenberg_experimental_global_styles_register_cpt' );
add_filter( 'body_class', 'gutenberg_experimental_global_styles_wp_gs_class_front_end' );
add_filter( 'admin_body_class', 'gutenberg_experimental_global_styles_wp_gs_class_editor' );
add_action( 'enqueue_block_assets', 'gutenberg_experimental_global_styles_enqueue_assets' );
add_filter( 'block_editor_settings', 'gutenberg_experimental_global_styles_settings' );
// enqueue_block_assets is not fired in edit-site, so we use back/front hooks instead.
add_action( 'wp_enqueue_scripts', 'gutenberg_experimental_global_styles_enqueue_assets' );
add_action( 'admin_enqueue_scripts', 'gutenberg_experimental_global_styles_enqueue_assets' );
}

0 comments on commit cac0947

Please sign in to comment.