From 3097cb315b8374824e2bf3f8afa96ceb16cfdeff 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: http://core.svn.wordpress.org/trunk@22989 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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;