mirror of
git://develop.git.wordpress.org/
synced 2025-02-24 16:43:06 +01:00
Fix autosave redirects
git-svn-id: https://develop.svn.wordpress.org/trunk@4088 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
89c450981a
commit
8988c209e9
@ -52,6 +52,7 @@ if (empty($post->post_status)) $post->post_status = 'draft';
|
||||
|
||||
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
<input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
|
||||
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
|
||||
<input type="hidden" name="post_author" value="<?php echo $post->post_author ?>" />
|
||||
<input type="hidden" id="post_type" name="post_type" value="post" />
|
||||
|
||||
|
@ -33,6 +33,7 @@ if (isset($mode) && 'bookmarklet' == $mode) {
|
||||
?>
|
||||
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
|
||||
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
|
||||
<?php echo $form_extra ?>
|
||||
<input type="hidden" id="post_type" name="post_type" value="page" />
|
||||
|
||||
|
@ -85,6 +85,26 @@ case 'editpost':
|
||||
|
||||
$page_ID = edit_post();
|
||||
|
||||
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 = 'page-new.php';
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$location = 'page-new.php?posted=true';
|
||||
}
|
||||
|
||||
if ( isset($_POST['save']) )
|
||||
$location = "page.php?action=edit&post=$page_ID";
|
||||
} else {
|
||||
if ($_POST['save']) {
|
||||
$location = "page.php?action=edit&post=$page_ID";
|
||||
} elseif ($_POST['updatemeta']) {
|
||||
@ -100,6 +120,7 @@ case 'editpost':
|
||||
} else {
|
||||
$location = 'page-new.php';
|
||||
}
|
||||
}
|
||||
wp_redirect($location); // Send user on their way while we keep working
|
||||
|
||||
exit();
|
||||
|
@ -92,6 +92,26 @@ case 'editpost':
|
||||
|
||||
$post_ID = edit_post();
|
||||
|
||||
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 {
|
||||
$referredby = '';
|
||||
if ( !empty($_POST['referredby']) )
|
||||
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
|
||||
@ -112,6 +132,7 @@ case 'editpost':
|
||||
} else {
|
||||
$location = 'post-new.php';
|
||||
}
|
||||
}
|
||||
|
||||
wp_redirect($location); // Send user on their way while we keep working
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user