From 87141a219f2817275b91a5d9e303ab97f7b283d2 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 4 Dec 2008 19:11:53 +0000 Subject: [PATCH] Page comments from the first page of a multi-page post. Props Viper007Bond. fixes #8450 git-svn-id: http://svn.automattic.com/wordpress/trunk@10039 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 70cc392746..6dce0c192f 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1214,24 +1214,12 @@ function posts_nav_link( $sep = ' — ', $prelabel = '« Previous Page' * @return string */ function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) { - global $wp_rewrite; + global $post, $wp_rewrite; $pagenum = (int) $pagenum; - $request = remove_query_arg( 'cpage' ); + $result = get_permalink( $post->ID ); - $home_root = parse_url(get_option('home')); - $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : ''; - $home_root = preg_quote( trailingslashit( $home_root ), '|' ); - - $request = preg_replace('|^'. $home_root . '|', '', $request); - $request = preg_replace('|^/+|', '', $request); - $request = preg_replace('|comment-page-[0-9]+/?$|', '', $request); - - $base = trailingslashit( get_bloginfo( 'home' ) ); - - $result = user_trailingslashit($base . $request); - if ( 'newest' == get_option('default_comments_page') ) { if ( $pagenum != $max_page ) { if ( $wp_rewrite->using_permalinks() )