-
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
Global styles: update __experimentalGetCurrentGlobalStylesId to return full global styles object #49976
Conversation
…the data from the endpoint and only returning the id. This change updates __experimentalGetCurrentGlobalStylesId to return the entire global style object instead of just the ID so we can access further global styles properties.
Size Change: +14 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Flaky tests detected in 6a7e651. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4761532480
|
Hey there! in several places we do this already:
Any reason why this is not good enough for your own use-cases? Unless I'm missing something, the changes in this PR seem to duplicate an entity record in two places in the store? |
Absolutely not, unless you're talking about my complete inability to test properly before I throw a PR up 😵💫 I was just pulling apart #49912 and this PR came out the other end. I'll close. Thank you @youknowriad !! |
Related to:
What?
This change updates
__experimentalGetCurrentGlobalStylesId
and associated store methods to return the entire global style object instead of just the ID so we can access further global styles properties.👋 Question: I though it was okay to change this method because it was experimental. Do folks see any backwards compatibility issues?
Also, would it be better to migrate the new function to the private/unlock system?
Why?
The intention is to add properties to the global styles response object, for example, an entry in
_links
that contains a revisions URL.See:
How?
Tweaking the methods so that they handle the entire global styles custom post response rather than just the ID.
The
__experimentalGetCurrentGlobalStylesId
resolver was fetching all the data from the endpoint and only returning the id.Testing Instructions
Using this branch, fire up the site editor and run the following command in your console:
Ensure that the object for the current theme's global styles custom post is returned:
Furthermore: