Advertisements

get_previous_comments_link

Definition:
function get_previous_comments_link( $label = '' ) {}

Return the previous comments page link.

Parameters

  • string $label: Optional. Label for comments link text.

Defined filters

  • previous_comments_link_attributes
    apply_filters( 'previous_comments_link_attributes', '' )

Source code

function get_previous_comments_link( $label = '' ) {

	if ( !is_singular() || !get_option('page_comments') )

		return;



	$page = get_query_var('cpage');



	if ( intval($page) <= 1 )

		return;



	$prevpage = intval($page) - 1;



	if ( empty($label) )

		$label = __('&laquo; Older Comments');



	return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) .'</a>';

}

1638

Advertisements

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: