Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

comment_post_redirect and comment_edit_redirect from Mark J. fixes #2590

git-svn-id: http://svn.automattic.com/wordpress/trunk@4260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit ac455f6df8ecce8e65679e83f76359969d865257 1 parent c0580ed
ryan authored
Showing with 6 additions and 8 deletions.
  1. +3 −6 wp-admin/comment.php
  2. +3 −2 wp-comments-post.php
View
9 wp-admin/comment.php
@@ -177,12 +177,9 @@
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:
View
5 wp-comments-post.php
@@ -57,8 +57,9 @@
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);
?>
Please sign in to comment.
Something went wrong with that request. Please try again.