Skip to content

Commit

Permalink
Conditionally remove deprecated 'print_emoji_styles' (#54828)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Sep 26, 2023
1 parent 3b1fd5b commit 6752a2a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/compat/wordpress-6.4/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,22 @@ function _gutenberg_get_iframed_editor_assets_6_4() {
}
}

// Remove the deprecated `print_emoji_styles` handler.
// It avoids breaking style generation with a deprecation message.
remove_action( 'wp_print_styles', 'print_emoji_styles' );
/**
* Remove the deprecated `print_emoji_styles` handler.
* It avoids breaking style generation with a deprecation message.
*/
$has_emoji_styles = has_action( 'wp_print_styles', 'print_emoji_styles' );
if ( $has_emoji_styles ) {
remove_action( 'wp_print_styles', 'print_emoji_styles' );
}

ob_start();
wp_print_styles();
$styles = ob_get_clean();
add_action( 'wp_print_styles', 'print_emoji_styles' );

if ( $has_emoji_styles ) {
add_action( 'wp_print_styles', 'print_emoji_styles' );
}

ob_start();
wp_print_head_scripts();
Expand Down

1 comment on commit 6752a2a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 6752a2a.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6314615312
📝 Reported issues:

Please sign in to comment.