Definition:
function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {}
Retrieve comments page number link.
Parameters
- int $pagenum: Optional. Page number.
- $max_page
Defined filters
- get_comments_pagenum_link
apply_filters('get_comments_pagenum_link', $result)
Source code
function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {
global $post, $wp_rewrite;
$pagenum = (int) $pagenum;
$result = get_permalink( $post->ID );
if ( 'newest' == get_option('default_comments_page') ) {
if ( $pagenum != $max_page ) {
if ( $wp_rewrite->using_permalinks() )
$result = user_trailingslashit( trailingslashit($result) . 'comment-page-' . $pagenum, 'commentpaged');
else
$result = add_query_arg( 'cpage', $pagenum, $result );
}
} elseif ( $pagenum > 1 ) {
if ( $wp_rewrite->using_permalinks() )
$result = user_trailingslashit( trailingslashit($result) . 'comment-page-' . $pagenum, 'commentpaged');
else
$result = add_query_arg( 'cpage', $pagenum, $result );
}
$result .= '#comments';
$result = apply_filters('get_comments_pagenum_link', $result);
return $result;
}
1286

February 12, 2011 


No comments yet... Be the first to leave a reply!