From 5fec33de253569879114cabf1a38a340f68ff08e Mon Sep 17 00:00:00 2001 From: azaozz Date: Sun, 7 Dec 2008 03:39:00 +0000 Subject: [PATCH] Show "Post submitted" message when contributors submit a post for review, props mdawaffe, fixes #8519 git-svn-id: http://svn.automattic.com/wordpress/trunk@10094 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 1 + wp-admin/edit-page-form.php | 1 + wp-admin/page.php | 10 +++++++--- wp-admin/post.php | 10 +++++++--- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index ae212c7166..904b9831c5 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -25,6 +25,7 @@ $messages[3] = __('Custom field deleted.'); $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) ) ); 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 c656050e58..e65be6224c 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -23,6 +23,7 @@ $messages[2] = __('Custom field updated.'); $messages[3] = __('Custom field deleted.'); $messages[4] = __('Page updated.'); $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) ) ); 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 97b28b9b23..91918b5596 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -42,10 +42,14 @@ function redirect_page($page_ID) { 'message' => 1 ), get_edit_post_link( $page_ID, 'url' ) ); else { - if ( isset( $_POST['publish'] ) ) - $location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) ); - else + 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' ) ); + } else { $location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) ); + } } } elseif ( isset($_POST['addmeta']) ) { $location = add_query_arg( 'message', 2, wp_get_referer() ); diff --git a/wp-admin/post.php b/wp-admin/post.php index af8e081394..5f04fa71ff 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -45,10 +45,14 @@ function redirect_post($post_ID = '') { 'message' => 1 ), get_edit_post_link( $post_ID, 'url' ) ); else { - if ( isset( $_POST['publish'] ) ) - $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) ); - else + 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' ) ); + } else { $location = add_query_arg( 'message', 7, get_edit_post_link( $post_ID, 'url' ) ); + } } } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) { $location = add_query_arg( 'message', 2, wp_get_referer() );