Change save page redirects. see #6024

git-svn-id: http://svn.automattic.com/wordpress/trunk@7116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-01 00:16:55 +00:00
parent 915e8d7721
commit 44fb2281f3

View File

@ -95,6 +95,7 @@ case 'editpost':
check_admin_referer('update-page_' . $page_ID);
$page_ID = edit_post();
$page = get_post($page_ID);
if ( 'post' == $_POST['originalaction'] ) {
if (!empty($_POST['mode'])) {
@ -121,7 +122,11 @@ case 'editpost':
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
if ($_POST['addmeta']) {
if ( isset($_POST['save']) && ( 'draft' == $page->post_status || 'pending' == $page->post_status ) ) {
$location = "page.php?action=edit&post=$page_ID";
} elseif ( isset($_POST['save']) && (empty($referredby) || $referredby == $referer) ) {
$location = "page.php?action=edit&post=$page_ID";
} elseif ($_POST['addmeta']) {
$location = add_query_arg( 'message', 2, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
@ -135,6 +140,8 @@ case 'editpost':
$location = get_permalink( $page_ID );
if ( false !== strpos($location, 'edit-pages.php') )
$location = add_query_arg('posted', $page_ID, $location);
} elseif ( isset($_POST['publish']) ) {
$location = "page-new.php?posted=$page_ID";
} elseif ($action == 'editattachment') {
$location = 'attachments.php';
} else {