[wp-trac] [WordPress Trac] #43316: REST API: Support autosaves

WordPress Trac noreply at wordpress.org
Thu Mar 8 19:09:08 UTC 2018


#43316: REST API: Support autosaves
-------------------------------------+-----------------------
 Reporter:  kraftbj                  |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  5.0
Component:  REST API                 |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  rest-api
-------------------------------------+-----------------------

Comment (by adamsilverstein):

 Replying to [comment:19 schlessera]:
 > My suggestion is to use a new route `/autosaves` extending the revisions
 controller.
 >

 I agree, this was my original idea in [attachment:autosave-
 controller.diff] and https://github.com/WordPress/gutenberg/pull/4156. not
 much has to change since autosaves are so close to revisions.

 > Letting the client decide whether to actually store the autosave or not
 is not recommend imho, because:

 The client does decide sometimes when to save an autosave verses a
 revision because these are functionally very different:
 * An autosave is created automatically by the client on a timed interval,
 whenever the post has changed from the last autosave. Autosaves protect
 against content loss if the browser crashes for example. one autosave is
 created per user, so each user has a backup of their editing session at
 all times.
 * Revisions are created when a draft post is saved, a published post is
 updated. This is the result of direct user action - clicking a button, and
 not automatically.

 Also:
 * Ideally the server should automatically create a revision if you have
 made significant changes. this way, if you typed a 10 thousand word
 document without saving, you would have revisions along the way not just a
 single autosave.
 * Currently published posts only get a revision when they are updated, it
 would be great if published posts captured revisions, the previous item
 would solve this.
 * Autosaves are used for previews. When previewing, an autosave is created
 of the current editor state, then that 'post' is previewed on the front
 end.

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


More information about the wp-trac mailing list