get_next_posts_page_link() WordPress Function

The get_next_posts_page_link() function retrieves the URL for the next posts page.

get_next_posts_page_link( int $max_page ) #

Retrieves the next posts page link.


Description

Backported from 2.1.3 to 2.0.10.


Top ↑

Parameters

$max_page

(int)(Optional) Max pages. Default 0.


Top ↑

Return

(string|void) The link URL for next posts page.


Top ↑

Source

File: wp-includes/link-template.php

function get_next_posts_page_link( $max_page = 0 ) {
	global $paged;

	if ( ! is_single() ) {
		if ( ! $paged ) {
			$paged = 1;
		}
		$nextpage = (int) $paged + 1;
		if ( ! $max_page || $max_page >= $nextpage ) {
			return get_pagenum_link( $nextpage );
		}
	}
}


Top ↑

Changelog

Changelog
VersionDescription
2.0.10Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More