Definition:
function get_next_comments_link( $label = '', $max_page = 0 ) {}
Return the link to next comments page.
Parameters
- string $label: Optional. Label for link text.
- int $max_page: Optional. Max page.
Defined filters
- next_comments_link_attributes
apply_filters( 'next_comments_link_attributes', '' )
Source code
function get_next_comments_link( $label = '', $max_page = 0 ) {
global $wp_query;
if ( !is_singular() || !get_option('page_comments') )
return;
$page = get_query_var('cpage');
$nextpage = intval($page) + 1;
if ( empty($max_page) )
$max_page = $wp_query->max_num_comment_pages;
if ( empty($max_page) )
$max_page = get_comment_pages_count();
if ( $nextpage > $max_page )
return;
if ( empty($label) )
$label = __('Newer Comments »');
return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) .'</a>';
}
1496

February 12, 2011 


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