Skip to content

Commit

Permalink
Change location of block support styles in <head> (#39164)
Browse files Browse the repository at this point in the history
* Use wp_head instead of wp_enqueue_scripts

* Updates documentation
  • Loading branch information
ndiego authored Mar 2, 2022
1 parent 067654c commit 8df8fb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/compat/wordpress-5.9/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ function gutenberg_enqueue_global_styles_assets() {
*
* For block themes, it's loaded in the head.
* For classic ones, it's loaded in the body
* because the wp_head action (and wp_enqueue_scripts)
* happens before the render_block.
* because the wp_head action happens before
* the render_block.
*
* @link https://core.trac.wordpress.org/ticket/53494.
*
Expand All @@ -63,7 +63,7 @@ function gutenberg_enqueue_global_styles_assets() {
function gutenberg_enqueue_block_support_styles( $style ) {
$action_hook_name = 'wp_footer';
if ( wp_is_block_theme() ) {
$action_hook_name = 'wp_enqueue_scripts';
$action_hook_name = 'wp_head';
}
add_action(
$action_hook_name,
Expand Down

0 comments on commit 8df8fb2

Please sign in to comment.