Skip to content

Commit

Permalink
Fix GitHub Actions failure due to duplicate functions (#44052)
Browse files Browse the repository at this point in the history
* Add redeclaration check of `wp_add_global_styles_for_blocks`

* Add skip redirection

* Use gutenberg_ prefix
  • Loading branch information
t-hamano authored Sep 12, 2022
1 parent d3cc24f commit 53d19c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Adds global style rules to the inline style for each block.
*/
function wp_add_global_styles_for_blocks() {
function gutenberg_add_global_styles_for_blocks() {
$tree = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data();
$block_nodes = $tree->get_styles_block_nodes();
foreach ( $block_nodes as $metadata ) {
Expand Down
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.1/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function gutenberg_enqueue_global_styles() {
wp_enqueue_style( 'global-styles' );

// add each block as an inline css.
wp_add_global_styles_for_blocks();
gutenberg_add_global_styles_for_blocks();
}

remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
Expand Down

0 comments on commit 53d19c2

Please sign in to comment.