Comment paging and sorting from Viper007Bond. see #7927

git-svn-id: https://develop.svn.wordpress.org/trunk@9296 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-10-23 16:08:47 +00:00
parent 88e2b9b5c3
commit 873a5b075b
9 changed files with 131 additions and 21 deletions

View File

@@ -79,7 +79,10 @@ if ( !$user->ID ) {
setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
}
$location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comment-' . $comment_id;
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 = apply_filters('comment_post_redirect', $location, $comment);
wp_redirect($location);