[wp-trac] [WordPress Trac] #64292: Global Styles: block style variations are sanitized out of global styles revisions
WordPress Trac
noreply at wordpress.org
Tue Nov 25 02:52:33 UTC 2025
#64292: Global Styles: block style variations are sanitized out of global styles
revisions
--------------------------------------+------------------------------
Reporter: ramonopoly | Owner: ramonopoly
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: rest-api
--------------------------------------+------------------------------
Changes (by ramonopoly):
* owner: (none) => ramonopoly
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"61301" 61301]:
{{{
#!CommitTicketReference repository="" revision="61301"
Global Styles Revisions: Preserve block style variations in global styles
revisions
When retrieving global styles revisions through the REST API, any block
style variations (e.g., `styles.blocks.core/group.variations.my-
variation`) are being removed during `WP_Theme_JSON` sanitization.
`WP_Theme_JSON` will only allow block style variations that are
registered.
This means user modifications to any theme block style variations were
being stripped from global styles revisions when retrieved via the REST
API.
This commit registers theme-defined block style variations in
`WP_REST_Global_Styles_Revisions_Controller::prepare_item_for_response` so
that they can be properly parsed by `WP_Theme_JSON`, and therefore added
to the global styles revisions REST API GET response.
Props ramonopoly, aaronrobertshaw, ellatrix.
Fixes #64292.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64292#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list