From b2572e4b11a9bc6362f77a4301ffd1c582fa11c0 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 28 Feb 2008 07:34:13 +0000 Subject: [PATCH] Change save post redirects. see #6024 git-svn-id: http://svn.automattic.com/wordpress/trunk@7084 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/post.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-admin/post.php b/wp-admin/post.php index 268407c62..a0c7ddaa3 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -101,6 +101,7 @@ case 'editpost': check_admin_referer('update-post_' . $post_ID); $post_ID = edit_post(); + $post = get_post($post_ID); if ( 'post' == $_POST['originalaction'] ) { if (!empty($_POST['mode'])) { @@ -127,7 +128,11 @@ case 'editpost': $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']); $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer()); - if (isset($_POST['addmeta']) && $_POST['addmeta']) { + if ( isset($_POST['save']) && ( 'draft' == $post->post_status || 'pending' == $post->post_status ) ) { + $location = "post.php?action=edit&post=$post_ID"; + } elseif ( isset($_POST['save']) && (empty($referredby) || $referredby == $referer) ) { + $location = "post.php?action=edit&post=$post_ID"; + } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) { $location = add_query_arg( 'message', 2, wp_get_referer() ); $location = explode('#', $location); $location = $location[0] . '#postcustom'; @@ -141,6 +146,8 @@ case 'editpost': $location = get_permalink( $post_ID ); if (false !== strpos($location, 'edit.php') ) $location = add_query_arg('posted', $post_ID, $location); + } elseif ( isset($_POST['publish']) ) { + $location = "post-new.php?posted=$post_ID"; } elseif ($action == 'editattachment') { $location = 'attachments.php'; } else {