[wp-hackers] Disable/ Stop "auto-draft" posts

Jeff Lambert jeff.lambert at jvhm.com
Tue Feb 28 16:50:37 UTC 2012


Appreciate the input on how drafts are cleaned up.  7 days seems like a long
time for an auto save draft to live but it's good to know this and that
cleaning does occur.

As for having to create the post to get the PostID, why not just generate a
PostID, put it into the Post form and then use it when the author saves the
Post, as opposed to actually saving the Post first?  I'm assuming there is a
downside somewhere but it would remove the need to have auto drafts (for
this purpose), remove the need to clean and remove some DB/comm overhead.



On 2/28/12 8:20 AM, "Otto" <otto at ottodestruct.com> wrote:

> On Tue, Feb 28, 2012 at 10:01 AM, Daniel Grundel
> <daniel at webpresencepartners.com> wrote:
>> I suspect if you removed support for 'revisions' that would stop happening,
>> but I could be totally wrong. Of course, you would also lose support for
>> storing multiple revisions of your posts. :)
> No, that wouldn't work.
> Auto-drafts exist because of the fact that multiple users can create
> new posts at the same time. If two people enter post-new at roughly
> the same moment, then have their first autosaves occur nearly
> simultaneously, then there is a race condition that can cause one of
> them to get back the wrong post ID, which will cause a post to be
> overwritten/lost when they then continue editing the post.
> The auto-draft creates the post and gets the ID of the new post before
> the editing screen is displayed, thus preventing two simultaneous
> authors from accidentally having the same post ID in the data in their
> browser.
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list