[wp-trac] [WordPress Trac] #43316: REST API: Support autosaves
WordPress Trac
noreply at wordpress.org
Tue Feb 20 08:50:57 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: | Focuses: rest-api
-------------------------+-----------------------
Comment (by azaozz):
Why not have the autosave functionality in REST API's `update_item()`.
Autosaves are regular saves that create revisions, just follow a bit
different logic.
43316.patch attempts to mimic how autosaves currently work through AJAX.
It uses a flag `is_autosave: true`.
The logic is:
1. For drafts:
- If the draft author is the same as the autosave author, overwrite the
draft post.
- If the draft author is different, create an autosave, or if it exists,
update it.
2. For published posts:
- Create or update autosaves for the autosave author.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43316#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list