[wp-trac] [WordPress Trac] #43316: REST API: Support autosaves
WordPress Trac
noreply at wordpress.org
Tue Mar 13 02:53:56 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 needs-unit- | Focuses: rest-api
tests |
-------------------------------------------------+-------------------------
Comment (by adamsilverstein):
@azaozz Thanks for the feedback and clarification.
> Hm, this is pretty useless for autosaves
I see what you mean - the singe endpoint is mostly useless, I think the
client would hit the collection endpoint, limiting to the a specific user.
> When would a client know the autosave ID for a post?
When the client autsaves, the api returns the created autosave ID. Also,
on load the id (and revisions ui link) is localized (in my PR) so in
theory the client might want to load that autosave data.
> Generally the client doesn't care about autosaves except when loading a
post for editing. Then it should "know" if there is an autosave that is
newer than the post.
I have this part in Gutenberg in
https://github.com/WordPress/gutenberg/pull/4218
> No. Autosaves are revisions and inherit the permissions of the parent
post. Anybody that can edit the post can view the autosaves (just like the
rest of the revisions).
Ah, right. So show all autosaves, with the ability to filter by user
> We shouldn't use the posts controller (with flags) for autosaving
Right I'm saying more that the posts controller shouldn't create revisions
when the post is in the draft state (unless they pass the threshold we
decide on).
Similarly, for published posts autosaves don't create a revision unless
they meet the threshold. Explicit saves always create a revision.
I'm going to be afk for about a week, then will return and pick this up.
Feel free to add the remaining changes.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43316#comment:36>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list