Redirect to the right place - http://mosquito.wordpress.org/view.php?id=510
git-svn-id: http://svn.automattic.com/wordpress/trunk@2333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6a11fa21a2
commit
f8efc5c837
@ -9,6 +9,13 @@ if (0 == $post_ID) {
|
|||||||
$form_action = 'editpost';
|
$form_action = 'editpost';
|
||||||
$form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />";
|
$form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sendto = $_SERVER['HTTP_REFERER'];
|
||||||
|
|
||||||
|
if ( $sendto == get_permalink($post) )
|
||||||
|
$sendto = 'redo';
|
||||||
|
$sendto = wp_specialchars( $sendto );
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form name="post" action="post.php" method="post" id="post">
|
<form name="post" action="post.php" method="post" id="post">
|
||||||
@ -79,7 +86,7 @@ edCanvas = document.getElementById('content');
|
|||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php $post_ID ? _e('Edit Page') :_e('Create New Page') ?> »" />
|
<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php $post_ID ? _e('Edit Page') :_e('Create New Page') ?> »" />
|
||||||
<input name="referredby" type="hidden" id="referredby" value="<?php if (isset($_SERVER['HTTP_REFERER'])) echo wp_specialchars($_SERVER['HTTP_REFERER']); ?>" />
|
<input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<fieldset id="pageoptions">
|
<fieldset id="pageoptions">
|
||||||
|
@ -342,19 +342,6 @@ case 'editpost':
|
|||||||
$datemodif_gmt = '';
|
$datemodif_gmt = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['save']) {
|
|
||||||
$location = $_SERVER['HTTP_REFERER'];
|
|
||||||
} elseif ($_POST['updatemeta']) {
|
|
||||||
$location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom';
|
|
||||||
} elseif ($_POST['deletemeta']) {
|
|
||||||
$location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom';
|
|
||||||
} elseif (isset($_POST['referredby']) && $_POST['referredby'] != $_SERVER['HTTP_REFERER']) {
|
|
||||||
$location = $_POST['referredby'];
|
|
||||||
} else {
|
|
||||||
$location = 'post.php';
|
|
||||||
}
|
|
||||||
header ('Location: ' . $location); // Send user on their way while we keep working
|
|
||||||
|
|
||||||
$now = current_time('mysql');
|
$now = current_time('mysql');
|
||||||
$now_gmt = current_time('mysql', 1);
|
$now_gmt = current_time('mysql', 1);
|
||||||
|
|
||||||
@ -378,6 +365,21 @@ case 'editpost':
|
|||||||
post_parent = '$post_parent'
|
post_parent = '$post_parent'
|
||||||
WHERE ID = $post_ID ");
|
WHERE ID = $post_ID ");
|
||||||
|
|
||||||
|
if ($_POST['save']) {
|
||||||
|
$location = $_SERVER['HTTP_REFERER'];
|
||||||
|
} elseif ($_POST['updatemeta']) {
|
||||||
|
$location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom';
|
||||||
|
} elseif ($_POST['deletemeta']) {
|
||||||
|
$location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom';
|
||||||
|
} elseif (isset($_POST['referredby']) && $_POST['referredby'] != $_SERVER['HTTP_REFERER']) {
|
||||||
|
$location = $_POST['referredby'];
|
||||||
|
if ( $_POST['referredby'] == 'redo' )
|
||||||
|
$location = get_permalink( $post_ID );
|
||||||
|
} else {
|
||||||
|
$location = 'post.php';
|
||||||
|
}
|
||||||
|
header ('Location: ' . $location); // Send user on their way while we keep working
|
||||||
|
|
||||||
// Meta Stuff
|
// Meta Stuff
|
||||||
if ($_POST['meta']) :
|
if ($_POST['meta']) :
|
||||||
foreach ($_POST['meta'] as $key => $value) :
|
foreach ($_POST['meta'] as $key => $value) :
|
||||||
|
Loading…
Reference in New Issue
Block a user