comment_post_redirect and comment_edit_redirect from Mark J. fixes #2590

git-svn-id: https://develop.svn.wordpress.org/trunk@4260 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-09-28 19:16:15 +00:00
parent 6863534b25
commit 8453685dc9
2 changed files with 6 additions and 8 deletions

View File

@ -177,12 +177,9 @@ case 'editedcomment':
edit_comment(); edit_comment();
$referredby = $_POST['referredby']; $location = ( empty($_POST['referredby']) ? "edit.php?p=$comment_post_ID&c=1" : $_POST['referredby'] ) . '#comment-' . $comment_ID;
if (!empty($referredby)) { $location = apply_filters('comment_edit_redirect', $location, $comment_ID);
wp_redirect($referredby); wp_redirect($location);
} else {
wp_redirect("edit.php?p=$comment_post_ID&c=1#comments");
}
break; break;
default: default:

View File

@ -57,8 +57,9 @@ if ( !$user->ID ) :
setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
endif; endif;
$location = ( empty( $_POST['redirect_to'] ) ) ? get_permalink( $comment_post_ID ) : $_POST['redirect_to']; $location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comment-' . $comment_id;
$location = apply_filters('comment_post_redirect', $location, $comment);
wp_redirect( $location ); wp_redirect($location);
?> ?>