WordPress 4.7 to Ship with Infrastructure from the Customize Snapshots Feature Plugin

photo credit: Chantel Lucas
photo credit: Chantel Lucas

Customize Changesets, the technical term for the infrastructure in the Customize Snapshots feature plugin, was merged into WordPress 4.7 yesterday. The project, formerly known as Customizer Transactions, brings the underlying architecture required for the ability to save a session as a draft. It enables WordPress to save a set of changes made in the Customizer so that it can be shared, previewed outside of the iframe, and even published at a future date.

Although the initial introduction of Customize Changesets will ship with no UI, it is the gateway for a host of exciting new features in the Customizer.

“The new APIs make possible many new user-facing features in future releases and feature plugins, including saving long-lived drafts, submitting changesets as pending for review, scheduling changes, seeing the previewed state on the frontend without being in an iframe, sharing preview URLs with others who do not have customizer access, and others,” project lead Weston Ruter said in the merge proposal.

Users will be able to detect the Customize Changesets architecture in WordPress in two ways. A new customize_uuid query parameter is added onto the URL. Also, users can now reload pages in the Customizer and the changes that have already been made will persist.

“In future releases we can explore new UIs to take advantage of the new capabilities that changesets provide,” Ruter said. “New UIs can provide a way to schedule changes, the ability to undo the last change, show an audit log (revision history) for changes, collaborative editing of a customizer changeset, and so on. Future feature projects will explore many of these and feature plugins will start to prototype them.”

Ruter also noted that Customize changesets fixes “several long-standing issues related to incompatibilities between JavaScript running on the site’s frontend when previewed in the customizer.” This should make the experience of customizing WordPress less buggy for users.

When I asked Ruter if the UI for core will come from the Customize Snapshots feature plugin, he said he’s not certain whether the team will migrate the features into a separate “Customize Changesets UI” plugin or adapt it to make use of changesets instead.

“Either way, the UI features will live on and will be prototyped in feature plugin form before proposal for core merge,” Ruter said. “The underlying plumbing from Snapshots was adapted for changesets now in core. So the snapshots itself needs its internals to be gutted to re-use changesets.”

From there contributors will begin building a UI for managing changesets, which includes listing existing changesets and their revisions, as well as moving a changeset post from auto-draft to draft, pending, or future. Ruter encourages those who want to contribute to a changesets UI for core to get involved in the Customize Snapshots plugin on GitHub.