Uses
| Uses | Description |
|---|---|
| wp-includes/query.php: is_single() | Determines whether the query is for an existing single post. |
| wp-includes/link-template.php: get_pagenum_link() | Retrieves the link for a page number. |
Retrieves the previous posts page link.
Will only return string, if not on a single page or post.
Backported to 2.0.10 from 2.1.3.
(string|void) The link for the previous posts page.
File: wp-includes/link-template.php
function get_previous_posts_page_link() {
global $paged;
if ( ! is_single() ) {
$nextpage = intval( $paged ) - 1;
if ( $nextpage < 1 ) {
$nextpage = 1;
}
return get_pagenum_link( $nextpage );
}
} | Version | Description |
|---|---|
| 2.0.10 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_previous_posts_page_link