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
This commit is contained in:
Andrew Nacin 2012-12-03 06:28:28 +00:00
parent c164b8e2c4
commit 8adec7a437
1 changed files with 3 additions and 0 deletions

View File

@ -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;