mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Fix autosave redirects
git-svn-id: https://develop.svn.wordpress.org/trunk@4088 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -92,25 +92,46 @@ case 'editpost':
|
||||
|
||||
$post_ID = edit_post();
|
||||
|
||||
$referredby = '';
|
||||
if ( !empty($_POST['referredby']) )
|
||||
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
|
||||
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
|
||||
|
||||
if ($_POST['save']) {
|
||||
$location = "post.php?action=edit&post=$post_ID";
|
||||
} elseif ($_POST['updatemeta']) {
|
||||
$location = wp_get_referer() . '&message=2#postcustom';
|
||||
} elseif ($_POST['deletemeta']) {
|
||||
$location = wp_get_referer() . '&message=3#postcustom';
|
||||
} elseif (!empty($referredby) && $referredby != $referer) {
|
||||
$location = $_POST['referredby'];
|
||||
if ( $_POST['referredby'] == 'redo' )
|
||||
$location = get_permalink( $post_ID );
|
||||
} elseif ($action == 'editattachment') {
|
||||
$location = 'attachments.php';
|
||||
if ( 'post' == $_POST['originalaction'] ) {
|
||||
if (!empty($_POST['mode'])) {
|
||||
switch($_POST['mode']) {
|
||||
case 'bookmarklet':
|
||||
$location = $_POST['referredby'];
|
||||
break;
|
||||
case 'sidebar':
|
||||
$location = 'sidebar.php?a=b';
|
||||
break;
|
||||
default:
|
||||
$location = 'post-new.php';
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$location = 'post-new.php?posted=true';
|
||||
}
|
||||
|
||||
if ( isset($_POST['save']) )
|
||||
$location = "post.php?action=edit&post=$post_ID";
|
||||
} else {
|
||||
$location = 'post-new.php';
|
||||
$referredby = '';
|
||||
if ( !empty($_POST['referredby']) )
|
||||
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
|
||||
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
|
||||
|
||||
if ($_POST['save']) {
|
||||
$location = "post.php?action=edit&post=$post_ID";
|
||||
} elseif ($_POST['updatemeta']) {
|
||||
$location = wp_get_referer() . '&message=2#postcustom';
|
||||
} elseif ($_POST['deletemeta']) {
|
||||
$location = wp_get_referer() . '&message=3#postcustom';
|
||||
} elseif (!empty($referredby) && $referredby != $referer) {
|
||||
$location = $_POST['referredby'];
|
||||
if ( $_POST['referredby'] == 'redo' )
|
||||
$location = get_permalink( $post_ID );
|
||||
} elseif ($action == 'editattachment') {
|
||||
$location = 'attachments.php';
|
||||
} else {
|
||||
$location = 'post-new.php';
|
||||
}
|
||||
}
|
||||
|
||||
wp_redirect($location); // Send user on their way while we keep working
|
||||
|
||||
Reference in New Issue
Block a user