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

Jeff Lambert jeff.lambert at jvhm.com
Tue Feb 28 17:20:09 UTC 2012


Figured it was something like this.  I've created client/server apps in the
past where we had functions that would be called to generate an ID for a
given table without actually inserting a row in that table.  Different
beast.  Makes sense that you might have some RI issues if there are other
WordPress features that need the row in wp_posts.

Cheers, Jeff


On 2/28/12 9:12 AM, "John Blackbourn" <johnbillion+wp at gmail.com> wrote:

> On 28 February 2012 16:50, Jeff Lambert <jeff.lambert at jvhm.com> wrote:
>> 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.
> 
> It's done this way so, for example, you have access to the $post
> object for new posts before they've been saved. As for your
> suggestion, you can only generate a valid post ID by inserting a row
> into the posts table, which is what WordPress does.
> 
> On a similar note, WordPress used to generate post IDs for new posts
> without inserting a row into the posts table. It generated negative
> post IDs, which were then changed when the post was saved. The current
> system is much more robust.
> _______________________________________________
> 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