get_next_posts_page_link( int $max_page = 0 ): string|void
- Since
- 2.0.10
- Source
wp-includes/link-template.php:2511
Retrieves the next posts page link.
Description
Backported from 2.1.3 to 2.0.10.
Parameters
$max_pageintoptional- Max pages. Default 0.Default:
0
Return
string|void- The link URL for next posts page.
Uses · 2
- is_single()Determines whether the query is for an existing single post.
- get_pagenum_link()Retrieves the link for a page number.
Used by · 1
- next_posts()Displays or retrieves the next posts page link.
Source
function get_next_posts_page_link( $max_page = 0 ) { global $paged; if ( ! is_single() ) { if ( ! $paged ) { $paged = 1; } $next_page = (int) $paged + 1; if ( ! $max_page || $max_page >= $next_page ) { return get_pagenum_link( $next_page ); } }}History
Introduced in 2.0.10. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Return type changed from
string|void to string|null.verified against source2.0.10
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, from
src/wp-includes/link-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.