diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 414e8fb14..d9dc2d86d 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -29,6 +29,7 @@ $messages[7] = __('Post saved.'); $messages[8] = sprintf(__('Post submitted. Preview post'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php $messages[9] = sprintf(__('Post scheduled for: %1$s. Preview post'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID)); +$messages[10] = sprintf(__('Draft updated. Preview'), get_permalink($post_ID)); if ( isset($_GET['revision']) ) $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); diff --git a/wp-admin/post.php b/wp-admin/post.php index a251e02cf..7dabac570 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -38,26 +38,31 @@ function redirect_post($post_ID = '') { $location = 'sidebar.php?a=c'; elseif ( isset($_POST['publish']) ) $location = 'sidebar.php?a=b'; - } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) { + } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) { + $status = get_post_status( $post_ID ); + $link = get_edit_post_link( $post_ID, 'url' ); + if ( isset( $_POST['publish'] ) ) { - switch ( get_post_status( $post_ID ) ) { + switch ( $status ) { case 'pending': - $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) ); + $message = 8; break; case 'future': - $location = add_query_arg( 'message', 9, get_edit_post_link( $post_ID, 'url' ) ); + $message = 9; break; default: - $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) ); + $message = 6; } } else { - $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) ); + $message = 'draft' == $status ? 10 : 1; } - } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) { + + $location = add_query_arg( 'message', $message, $link ); + } elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) { $location = add_query_arg( 'message', 2, wp_get_referer() ); $location = explode('#', $location); $location = $location[0] . '#postcustom'; - } elseif (isset($_POST['deletemeta']) && $_POST['deletemeta']) { + } elseif ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) { $location = add_query_arg( 'message', 3, wp_get_referer() ); $location = explode('#', $location); $location = $location[0] . '#postcustom';