-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Backport 59764 Add filter for duotone to account for gutenberg_restore_image_outer_container in classic themes #6719
Conversation
…e_image_outer_container in classic themes
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
These imports cause side-effects with filters, so they should be in the same order in both places to avoid issues
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.
From WordPress/gutenberg#59764 (comment)
So with the plugin active, both Gutenberg layout hook and the new duotone hook should be running. The duotone one runs after the layout one because of the order they're defined in
When this gets backported to core, the same should happen with the core version of the functions. Although, it looks like the imports will have to be reordered during the core backport (WordPress/wordpress-develop@
9a616a5
/src/wp-settings.php#L371).In my opinion, with the way WordPress code is written with side effects in many files, the way that we mostly centralize imports, the size of the codebase, and the number of contributors, it makes more sense for use to just preserve the order of imports when backporting things to not have to worry so much about priority levels. It seems better to me to maintain that order than force extenders to use extra high priorities to override core behavior.
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.
This makes sense. Do we know why they were added to core in a different order in the first place?
We'll need to test that all these supports combined are still working as expected on this PR.
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.
I've tested the reordered block supports with both a classic and a block theme and there don't seem to be any changes.
The duotone filter is working as expected with aligned images on classic themes.
There are no changes for aligned images on block themes.
Code LGTM!
Given how close we are to Beta 1 I think it's OK to commit this as is but as a follow-up it would be nice to add a unit test for the new function
Committed in r58313. |
Backport for WordPress/gutenberg#59764
Trac ticket: https://core.trac.wordpress.org/ticket/61271
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.