Always convert auto-drafts to drafts in edit_draft() and _wp_translate_postdata().

This regressed due to refactoring in [26995]. This commit fixes Quick Draft.

see #25272.

Built from https://develop.svn.wordpress.org/trunk@27405


git-svn-id: http://core.svn.wordpress.org/trunk@27252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-03-05 06:26:14 +00:00
parent 886a8e9549
commit 39fcb291fe

View File

@ -83,8 +83,9 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
$post_data['post_status'] = sanitize_key( $post_data['post_status'] );
// No longer an auto-draft
if ( 'auto-draft' == $post_data['post_status'] )
if ( 'auto-draft' === $post_data['post_status'] ) {
$post_data['post_status'] = 'draft';
}
}
// What to do based on which button they pressed
@ -113,8 +114,9 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
if ( ! in_array( $previous_status, $published_statuses ) || !current_user_can( 'edit_post', $post_id ) )
$post_data['post_status'] = 'pending';
if ( ! isset($post_data['post_status']) )
$post_data['post_status'] = $previous_status;
if ( ! isset( $post_data['post_status'] ) ) {
$post_data['post_status'] = 'auto-draft' === $previous_status ? 'draft' : $previous_status;
}
if (!isset( $post_data['comment_status'] ))
$post_data['comment_status'] = 'closed';