From 8453685dc9c92ddc044cdb1b741697399baea12b Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 28 Sep 2006 19:16:15 +0000 Subject: [PATCH] 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 --- wp-admin/comment.php | 9 +++------ wp-comments-post.php | 5 +++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 1610e3008b..a8c918b778 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -177,12 +177,9 @@ case 'editedcomment': edit_comment(); - $referredby = $_POST['referredby']; - if (!empty($referredby)) { - wp_redirect($referredby); - } else { - wp_redirect("edit.php?p=$comment_post_ID&c=1#comments"); - } + $location = ( empty($_POST['referredby']) ? "edit.php?p=$comment_post_ID&c=1" : $_POST['referredby'] ) . '#comment-' . $comment_ID; + $location = apply_filters('comment_edit_redirect', $location, $comment_ID); + wp_redirect($location); break; default: diff --git a/wp-comments-post.php b/wp-comments-post.php index 0563e0fc60..155a77b65f 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -57,8 +57,9 @@ if ( !$user->ID ) : setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); 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); ?>