Backport from core: Global styles duotone not rendering in post editor#38897
Merged
Conversation
Contributor
Author
|
I see an issue that the SVGs are getting generated at the bottom of the body when testing against 5.9.0. I will look at that tomorrow, but until then, the rest can still be tested. |
oandregal
reviewed
Feb 18, 2022
oandregal
reviewed
Feb 18, 2022
oandregal
approved these changes
Feb 18, 2022
Member
oandregal
left a comment
There was a problem hiding this comment.
The code is the same as in core, so this can go in.
The function name is not a blocker, just a convention we follow. The other one we should address as a follow-up and port to 5.9.1 as well.
Contributor
hellofromtonya
left a comment
There was a problem hiding this comment.
Sorry for my tardiness in reviewing. LGTM 👍
Thanks @ajlende for porting these changes back to this repo ⭐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport the changes from changeset/52768. As part of the 5.9.1-RC1 release, these changes were made to core.
In addition, since core is loading the global duotone SVG filters, they can be skipped in the plugin if running with WP 5.9.1 or later.
Testing
Using wordpress-develop 5.9.0 and 5.9.1-RC1.
Using a theme that uses global duotone styles such as Skatepark or Twenty Twenty-Two with the following added to the theme.json
{ "styles": { "blocks": { "core/image": { "filter": { "duotone": "var(--wp--preset--duotone--primary-and-secondary)" } } } } }Check that the global duotones are applied to images in the post editor without manually adding them via the block interface. And check that there are no duplicate SVGs generated (ex.
#wp-duotone-dark-grayscale).Screenshots