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
This commit is contained in:
parent
b8a9b78359
commit
3097cb315b
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue