Don't redirect back to permalink after editing from Edit This link. fixes #7503 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@8625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-08-12 20:58:00 +00:00
parent 7e141e4192
commit 6ff77fabe3
3 changed files with 3 additions and 21 deletions

View File

@ -76,14 +76,7 @@ $saveasdraft = '<input name="save" type="submit" id="save" class="button" tabind
<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php
if ( !empty($_REQUEST['popupurl']) )
echo clean_url(stripslashes($_REQUEST['popupurl']));
else if ( strpos( wp_get_referer(), '/wp-admin/' ) === false && $post_ID && url_to_postid(wp_get_referer()) == $post_ID )
echo 'redo';
else
echo clean_url(stripslashes(wp_get_referer()));
?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
<?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
<?php echo $form_extra ?>

View File

@ -34,10 +34,6 @@ if ( 0 == $post_ID) {
$temp_ID = (int) $temp_ID;
$user_ID = (int) $user_ID;
$sendto = clean_url(stripslashes(wp_get_referer()));
if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
$sendto = 'redo';
?>
<?php if ( $notice ) : ?>
@ -64,12 +60,7 @@ if (isset($mode) && 'bookmarklet' == $mode)
<?php echo $form_extra ?>
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php
if ( strpos( wp_get_referer(), '/wp-admin/' ) === false && $post_ID && url_to_postid(wp_get_referer()) == $post_ID )
echo 'redo';
else
echo clean_url(stripslashes(wp_get_referer()));
?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
<?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
<div id="poststuff">

View File

@ -39,9 +39,7 @@ function redirect_post($post_ID = '') {
} elseif (!empty($referredby) && $referredby != $referer) {
$location = $_POST['referredby'];
$location = remove_query_arg('_wp_original_http_referer', $location);
if ( $_POST['referredby'] == 'redo' )
$location = get_permalink( $post_ID );
elseif ( false !== strpos($location, 'edit.php') )
if ( false !== strpos($location, 'edit.php') )
$location = add_query_arg('posted', $post_ID, $location);
elseif ( false !== strpos($location, 'wp-admin') )
$location = "post-new.php?posted=$post_ID";