From 71278343c2c0003eee73d6559297a19d7612175b Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 4 Nov 2008 03:31:19 +0000 Subject: [PATCH] Redirect back to correct comment page after replying. Props Viper007Bond. fixes #8055 git-svn-id: http://svn.automattic.com/wordpress/trunk@9507 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-comments-post.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wp-comments-post.php b/wp-comments-post.php index d026a6db1..787b25c07 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -79,10 +79,7 @@ if ( !$user->ID ) { setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); } -if ( empty($_POST['redirect_to']) ) - $postlink = ( 'newest' == get_option('default_comments_page') ) ? get_permalink($comment_post_ID) : add_query_arg( 'cpage', get_comment_pages_count( get_comments( array( 'post_id' => $comment_post_ID ) ) ), get_permalink($comment_post_ID) ); - -$location = ( empty($_POST['redirect_to']) ? $postlink : $_POST['redirect_to'] ) . '#comment-' . $comment_id; +$location = ( empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] ) . '#comment-' . $comment_id; $location = apply_filters('comment_post_redirect', $location, $comment); wp_redirect($location);