get_previous_posts_page_link

The timeline below displays how wordpress function get_previous_posts_page_link has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * 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.
 *
 * @since 2.0.10
 *
 * @global int $paged
 *
 * @return string|void The link for the previous posts page.
 */
function get_previous_posts_page_link()
{
    global $paged;
    if (!is_single()) {
        $previous_page = (int) $paged - 1;
        if ($previous_page < 1) {
            $previous_page = 1;
        }
        return get_pagenum_link($previous_page);
    }
}

WordPress Version: 5.6

/**
 * 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.
 *
 * @since 2.0.10
 *
 * @global int $paged
 *
 * @return string|void The link for the previous posts page.
 */
function get_previous_posts_page_link()
{
    global $paged;
    if (!is_single()) {
        $nextpage = (int) $paged - 1;
        if ($nextpage < 1) {
            $nextpage = 1;
        }
        return get_pagenum_link($nextpage);
    }
}

WordPress Version: 4.6

/**
 * 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.
 *
 * @since 2.0.10
 *
 * @global int $paged
 *
 * @return string|void The link for the previous posts page.
 */
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);
    }
}

WordPress Version: 4.3

/**
 * Retrieve 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.
 *
 * @since 2.0.10
 *
 * @global int $paged
 *
 * @return string|void The link for the previous posts page.
 */
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);
    }
}

WordPress Version: 4.1

/**
 * Retrieve 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.
 *
 * @since 2.0.10
 *
 * @return string|null The link for the previous posts page.
 */
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);
    }
}

WordPress Version: 3.7

/**
 * Retrieve 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.
 *
 * @since 2.0.10
 *
 * @return string|null
 */
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);
    }
}