From 8adec7a43707411bf4bb1e0659f71ceb984964ec Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 3 Dec 2012 06:28:28 +0000 Subject: [PATCH] Do not save an initial revision for a post created through the auto-draft mechanism. Prevents a bogus revision, often with the title 'Auto Draft'. Restores pre-auto-draft behavior made obvious by XML-RPC's implementation of both auto-drafts and the subsequent wp.getRevisions method. fixes #22687. see #22686. git-svn-id: https://develop.svn.wordpress.org/trunk@22989 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index 7891ec44ef..54f17f4159 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4921,6 +4921,9 @@ function wp_save_post_revision( $post_id ) { if ( !$post = get_post( $post_id, ARRAY_A ) ) return; + if ( 'auto-draft' == $post['post_status'] ) + return; + if ( !post_type_supports($post['post_type'], 'revisions') ) return;