Show "Draft updated" instead of "Post updated" when saving drafts.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-10-10 07:24:05 +00:00
parent ee12f818b7
commit 3d1fa0d0d1
2 changed files with 14 additions and 8 deletions

View File

@ -29,6 +29,7 @@ $messages[7] = __('Post saved.');
$messages[8] = sprintf(__('Post submitted. <a href="%s">Preview post</a>'), 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: <b>%1$s</b>. <a href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID));
$messages[10] = sprintf(__('Draft updated. <a href="%s">Preview</a>'), 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 ) );

View File

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