Page comments from the first page of a multi-page post. Props Viper007Bond. fixes #8450

git-svn-id: https://develop.svn.wordpress.org/trunk@10039 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-12-04 19:11:53 +00:00
parent 85bb38adc9
commit 8db8771085
1 changed files with 2 additions and 14 deletions

View File

@ -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() )