Revert "Update function names for the public global styles API functions"#36957
Closed
Revert "Update function names for the public global styles API functions"#36957
Conversation
This was referenced Nov 29, 2021
Member
Author
|
I'm going to close this. I ran this by some folks for thoughts (Riad, Jorge) and this is the consensus:
The rationale for this is that we want to remove as much code from the plugin as possible and this is another step in that direction for global styles. cc some folks I know contributed to the GS code for awareness @getdave @noisysocks @aaronrobertshaw @andrewserong @scruffian @fabiankaegy @Mamaduka @carolinan @ajlende @aristath @walbo |
Member
Author
|
Draft PR to move the global styles related code under |
Member
Author
|
#36978 is ready for review. |
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.
Reverts #36907
What this PR fixes
When the plugin is active in WordPress 5.9, it doesn't override global styles WordPress core public API.
Context
In #36907 I renamed the public API of GS from
gutengerg_*towp_*), to make backport easier and make the functions available in all the WordPress versions the plugin supports. I hoped that we could introduce some filters at #36909 to modify their behavior from the plugin. However, we decided against that, and, as a side-effect, we don't have a way to overwrite the WordPress core functions when the plugin runs on WordPress 5.9.Follow-ups post 5.9
We'd need to clarify how to best address the following (can be done post-5.9):
What happens when/if we need to modify the behavior of the public GS API? In principle, we shouldn't update code that lives in
lib/compat/5.9after WordPress 5.9 has been released.What happens if we don't need to modify the behavior of those functions and the plugin minimum version is 5.9 (so the
lib/compat/5.9is removed? At that point, we can't remove the functions from the plugin as we may still need them to overwrite the core behavior.Unless I'm missing something, it looks like the code for the public API of GS should not live in
lib/compat.