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
This commit is contained in:
parent
fd5a7d8a18
commit
87141a219f
|
@ -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() )
|
||||
|
|
Loading…
Reference in New Issue