[wp-trac] [WordPress Trac] #39896: Customizer: Allow users to Draft changes before Publishing

WordPress Trac noreply at wordpress.org
Fri Sep 15 18:32:29 UTC 2017


#39896: Customizer: Allow users to Draft changes before Publishing
-------------------------------------------------+-------------------------
 Reporter:  melchoyce                            |       Owner:
     Type:  enhancement                          |  westonruter
 Priority:  normal                               |      Status:  accepted
Component:  Customize                            |   Milestone:  4.9
 Severity:  normal                               |     Version:
 Keywords:  has-patch needs-testing needs-unit-  |  Resolution:
  tests                                          |     Focuses:  ui
-------------------------------------------------+-------------------------
Changes (by westonruter):

 * keywords:   => has-patch needs-testing needs-unit-tests


Comment:

 The PHP side of autosaving has been initially implemented and it is
 feeling good: https://github.com/xwp/wordpress-develop/pull/256

 * If you go into the customizer on a fresh site and make changes, and then
 reload, you'll get a fresh blank Customizer when you reload but with a
 notice about restoring the auto-draft.
 * If you open up the console and then do `wp.customize.previewer.save({
 status: 'draft' })` (since there is no UI yet) and then reload, you'll
 automatically get the changeset auto-loaded from the start.
 * If you make additional changes on top of a drafted changeset, and then
 reload, you'll get a notice about the autosave revision with a link to
 load those changes.
 * In the same way that a user can only have one autosave revision, a user
 can also only have one auto-draft changeset. If you open the Customizer
 without any drafted changes existing, and you disregard the notice about
 there being an auto-draft available, as soon as you make a change and the
 new auto-draft is created, the previous one will be deleted.

 This autosave part of things needs:

 * A filter for plugins (like Customize Snapshots) to opt-in to non-linear
 changeset mode, and then using this filter to modify the behavior for
 whether the `changeset_uuid` param gets dynamically added to the location,
 whether a drafted changeset gets auto-loaded, whether there can be
 multiple auto-draft posts living concurrently, and so on.
 * User testing. One thing I'm not sure about is how best to deal with is
 when two users are working in the Customizer. If they both have changes
 auto-drafted, and then user A clicks to save draft, if user B then reloads
 the Customizer then they will see the drafted changes auto-loaded from
 user A without the option for user B to restore their auto-drafted
 changes, until the changeset from user A is published. Maybe that makes
 sense, but it's just not something I considered before.
 * Code review and overall evaluation of the architecture changes.
 * Addition of PHPUnit tests. Existing unit tests pass, so the API changes
 seem to be backwards-compatible.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39896#comment:64>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list