Opened 3 months ago
Last modified 7 weeks ago
#23665 new enhancement
Create one autosave per user
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Autosave | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Currently when autosaving drafts we overwrite them, when autosaving published posts, we keep one autosaved revision. This works well as long as there is only one post author.
Having per-user autosaves will affect only sites with many authors/editors. It will avoid overwriting when more than one user edits a post, provide better audit trail, and let us auto save data stored in the browser even if another user is editing at that moment.
Attachments (6)
Change History (13)
In 23665-2.patch:
- Don't short-circuit wp_get_post_revisions() when WP_POST_REVISIONS is false. It is used to get the autosave(s) too.
- Show the correct preview to each user when several users are editing.
23665-post-name.patch short-circuits wp_unique_post_slug() for post revisions. Currently revisions are saved with post_name {$post->post_parent}-revision, and autosaves: {$post->post_parent}-autosave. When there are more than one, wp_unique_post_slug kicks in and adds -2, -3, etc. to the end. This is intended for post slugs and not necessary for revisions. If we remove it, or remove it only for autosaves, we can run a different query to fetch only the autosaves for a post instead of looping through all revisions as in the other patch.
In 23665-3.patch:
- Update wp_ajax_autosave() removing post locks references.
- Update autosave.js removing post locks and logged out warnings.
johnjamesjacoby — 5 weeks ago
Introduce wp_get_preview_post_url() to funnel post-preview URL handling through, and replace in all instances. Also patches _set_preview() and moves _show_post_preview() to 'set_current_user' priority 20 instead.

In 23631: