-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove action to fix tests. #54806
Remove action to fix tests. #54806
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,9 +158,13 @@ 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' ); | ||
ob_start(); | ||
wp_print_styles(); | ||
$styles = ob_get_clean(); | ||
add_action( 'wp_print_styles', 'print_emoji_styles' ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we check to see if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a common pattern for temporarily removing actions. We do the same above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where do we do it above? Sorry if I'm missing something obvious! I can see I'm a little unsure of the consequences of making changes here, which is why I'm a little bit cautious about the changes. I don't quite understand the scope of what was introduced in WordPress/wordpress-develop#4824, so am a tiny bit nervous about the fix in this PR, particularly since this PR didn't have any explanation as to why the fix was required. I'd probably lean more toward reviewing whether WordPress/wordpress-develop#4824 should be reverted, as it introduced a regression in core. That said, I'm very much in favour of pragmatic fixes that unblock merging in Gutenberg, so please don't take my comments here as a blocker to landing this PR if it fixes things 🙂 |
||
|
||
ob_start(); | ||
wp_print_head_scripts(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this works, it feels a little hacky to me. Why do we need to remove core actions in order for the output to work correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deprecation
print_emoji_styles
function is still hooked intowp_print_styles
for backward compatibility. Core handles its removal differently, so we must resort to manual removal.I'm open to suggestions for a better fix.