Better feedback on publishing of future posts and pages. Fixes #10711 based on patch from scribu.

git-svn-id: http://svn.automattic.com/wordpress/trunk@11897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-09-01 21:15:20 +00:00
parent 499a4d63cc
commit 2918ccefd5
4 changed files with 24 additions and 8 deletions

View File

@ -27,6 +27,8 @@ $messages[4] = __('Post updated.');
$messages[6] = sprintf(__('Post published. <a href="%s">View post</a>'), get_permalink($post_ID)); $messages[6] = sprintf(__('Post published. <a href="%s">View post</a>'), get_permalink($post_ID));
$messages[7] = __('Post saved.'); $messages[7] = __('Post saved.');
$messages[8] = sprintf(__('Post submitted. <a href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); $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));
if ( isset($_GET['revision']) ) if ( isset($_GET['revision']) )
$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );

View File

@ -27,6 +27,8 @@ $messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.'); $messages[3] = __('Custom field deleted.');
$messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID)); $messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID));
$messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); $messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</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[7] = sprintf(__('Page 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));
if ( isset($_GET['revision']) ) if ( isset($_GET['revision']) )
$messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); $messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );

View File

@ -37,10 +37,16 @@ function redirect_page($page_ID) {
$location = 'sidebar.php?a=b'; $location = 'sidebar.php?a=b';
} elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) { } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
if ( isset( $_POST['publish'] ) ) { if ( isset( $_POST['publish'] ) ) {
if ( 'pending' == get_post_status( $page_ID ) ) switch ( get_post_status( $page_ID ) ) {
$location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) ); case 'pending':
else $location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) );
$location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) ); break;
case 'future':
$location = add_query_arg( 'message', 7, get_edit_post_link( $page_ID, 'url' ) );
break;
default:
$location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) );
}
} else { } else {
$location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) ); $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) );
} }

View File

@ -40,10 +40,16 @@ function redirect_post($post_ID = '') {
$location = 'sidebar.php?a=b'; $location = 'sidebar.php?a=b';
} elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) { } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
if ( isset( $_POST['publish'] ) ) { if ( isset( $_POST['publish'] ) ) {
if ( 'pending' == get_post_status( $post_ID ) ) switch ( get_post_status( $post_ID ) ) {
$location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) ); case 'pending':
else $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) );
$location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) ); break;
case 'future':
$location = add_query_arg( 'message', 9, get_edit_post_link( $post_ID, 'url' ) );
break;
default:
$location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
}
} else { } else {
$location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) ); $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) );
} }