From 0811d99fbd1da890f301b431b0396a892e452be9 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Tue, 1 Sep 2009 21:15:20 +0000 Subject: [PATCH] Better feedback on publishing of future posts and pages. Fixes #10711 based on patch from scribu. git-svn-id: https://develop.svn.wordpress.org/trunk@11897 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/edit-form-advanced.php | 2 ++ wp-admin/edit-page-form.php | 2 ++ wp-admin/page.php | 14 ++++++++++---- wp-admin/post.php | 14 ++++++++++---- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 73a252d39d..7cce1f9412 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -27,6 +27,8 @@ $messages[4] = __('Post updated.'); $messages[6] = sprintf(__('Post published. View post'), get_permalink($post_ID)); $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)); 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/edit-page-form.php b/wp-admin/edit-page-form.php index 65a3123169..b4d1b7db84 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -27,6 +27,8 @@ $messages[2] = __('Custom field updated.'); $messages[3] = __('Custom field deleted.'); $messages[5] = sprintf(__('Page published. View page'), get_permalink($post_ID)); $messages[6] = sprintf(__('Page submitted. Preview page'), 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: %1$s. Preview post'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID)); if ( isset($_GET['revision']) ) $messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); diff --git a/wp-admin/page.php b/wp-admin/page.php index 61bfe1e575..fcb7bd205e 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -37,10 +37,16 @@ function redirect_page($page_ID) { $location = 'sidebar.php?a=b'; } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) { if ( isset( $_POST['publish'] ) ) { - if ( 'pending' == get_post_status( $page_ID ) ) - $location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) ); - else - $location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) ); + switch ( get_post_status( $page_ID ) ) { + case 'pending': + $location = add_query_arg( 'message', 6, 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 { $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) ); } diff --git a/wp-admin/post.php b/wp-admin/post.php index 14e32c99d2..35636448ab 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -40,10 +40,16 @@ function redirect_post($post_ID = '') { $location = 'sidebar.php?a=b'; } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) { if ( isset( $_POST['publish'] ) ) { - if ( 'pending' == get_post_status( $post_ID ) ) - $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) ); - else - $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) ); + switch ( get_post_status( $post_ID ) ) { + case 'pending': + $location = add_query_arg( 'message', 8, 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 { $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) ); }