Revert "Update function names for the public global styles API functions" #36957
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.9
after 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.9
is 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
.