[wp-trac] [WordPress Trac] #43316: REST API: Support autosaves
WordPress Trac
noreply at wordpress.org
Thu Mar 8 19:46:41 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 azaozz):
> The /autosaves endpoint would be used on the client to "trigger" an
autosave.
Currently autosaves would either update or create a revision, or update
the actual post if it is a draft. We need the Autosaves controller to be
able to handle updating the post too (without creating another revision).
> 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.
Right. This is not a new idea, been around for some years. Not implemented
till now because of "revisions use too much resources" concerns. Lately we
are using posts (CPTs) for whatnot, lets add it, would be a good user
facing enhancement :)
The only thing I'm not sure about is how to detect when significant
changes have been made in the incoming autosave. A simple strlen() might
work, but... not that good. The other option is to make a diff with the
latest revision and count the changes.
> 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.
Yes, it will. Also don't see a problem for the client to save a new
revision whenever. There is a revisions controller for that :)
@adamsilverstein could you update your patch as per the above :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43316#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list