Advertisements

get_comments_pagenum_link

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

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: