Opened 21 months ago
Last modified 4 days ago
#31089 new enhancement
Add revisions of settings to the Customizer
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Customize | Keywords: | |
| Focuses: | javascript | Cc: |
Description (last modified by westonruter)
In #30937 the concept of a “Customizer Transaction” is introduced, wherein each Customizer session gets a transaction containing the settings that are modified and eventually saved (or not). The wp_transaction is a custom post type with the settings JSON stored in the post_content. Every time the Customizer is accessed, a new wp_transaction post is created with post_status=draft and then when saving it becomes post_status=publish. As such, this automatically becomes a revision history for all saved changes to the Customizer.
With the work on Transactions, however, there is no UI for accessing these revisions. There is no way to see previous revisions, to revert a revision, to recall a revision to continue changes.
I did do some work on a Settings Revisions plugin for a potential UI, where a new Customizer section is added to load a previous revision and to provide the “commit message” for the new one (see plugin screenshots). However, this plugin was written before transactions.
See also:
#21666 (Customizer reset/undo/revert)
#20692 (Handle unsaved changes in the customizer)
#28721 (Scheduled changes for the customizer)
#31088 (Post revisions in the customizer)
Change History (7)
This ticket was mentioned in Slack in #core by westonruter. View the logs.
21 months ago
#3
@westonruter
21 months ago
- Description modified (diff)
- Summary changed from Add revisions to the Customizer to Add revisions of settings to the Customizer
#4
@westonruter
21 months ago
#5
@celloexpressions
9 months ago
Is this something that could be in scope for transactions or would it be better to build on after the underlying support is done? I'm envisioning adding a split dropdown arrow to the save & publish button that opens up options like scheduled changes and revisions, and other related things that transactions would enable.
#6
@westonruter
9 months ago
UI would be out of scope for transactions, but the underlying backend infrastructure would be in place with the introduction of transactions. A setting revisions plugin would be a good feature plugin to propose for Core inclusion after transactions are in place.
#7
@folletto
5 days ago
Just noting that the revision UI proposed in the Additional CSS feature in #35395 can be adapted and used to be a global versioning system instead of just for CSS. :)
#8
@westonruter
4 days ago
@folletto yes, Customize Changesets (#30937) actually result in a new revision of customizer settings for every publish. At the moment the changesets get automatically garbage-collected since there is no UI, but if a plugin adds revisions support to the customize_changeset post type, then published changeset posts will persist. Revision history for a given setting can then be extracted from those published customize_changeset posts.
This would be a good feature plugin, especially extending transactions in #30937 with a UI.