Commit c252a2f
committed
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.
Built from https://develop.svn.wordpress.org/trunk@61301
git-svn-id: http://core.svn.wordpress.org/trunk@60613 1a063a9b-81f0-0310-95a4-ce76da25c4cd1 parent 893f17b commit c252a2f
File tree
2 files changed
+10
-1
lines changed- wp-includes
- rest-api/endpoints
2 files changed
+10
-1
lines changedLines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
315 | 324 | | |
316 | 325 | | |
317 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments