Fix autosave redirects
git-svn-id: http://svn.automattic.com/wordpress/trunk@4088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
83665b2bf5
commit
a458715afa
|
@ -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…
Reference in New Issue