next_posts

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

WordPress Version: 6.4

/**
 * Displays or retrieves the next posts page link.
 *
 * @since 0.71
 *
 * @param int  $max_page Optional. Max pages. Default 0.
 * @param bool $display  Optional. Whether to echo the link. Default true.
 * @return string|void The link URL for next posts page if `$display = false`.
 */
function next_posts($max_page = 0, $display = true)
{
    $link = get_next_posts_page_link($max_page);
    $output = $link ? esc_url($link) : '';
    if ($display) {
        echo $output;
    } else {
        return $output;
    }
}

WordPress Version: 6.2

/**
 * Displays or retrieves the next posts page link.
 *
 * @since 0.71
 *
 * @param int  $max_page Optional. Max pages. Default 0.
 * @param bool $display  Optional. Whether to echo the link. Default true.
 * @return string|void The link URL for next posts page if `$display = false`.
 */
function next_posts($max_page = 0, $display = true)
{
    $output = esc_url(get_next_posts_page_link($max_page));
    if ($display) {
        echo $output;
    } else {
        return $output;
    }
}

WordPress Version: 5.5

/**
 * Displays or retrieves the next posts page link.
 *
 * @since 0.71
 *
 * @param int  $max_page Optional. Max pages. Default 0.
 * @param bool $echo     Optional. Whether to echo the link. Default true.
 * @return string|void The link URL for next posts page if `$echo = false`.
 */
function next_posts($max_page = 0, $echo = true)
{
    $output = esc_url(get_next_posts_page_link($max_page));
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}

WordPress Version: 4.6

/**
 * Displays or retrieves the next posts page link.
 *
 * @since 0.71
 *
 * @param int   $max_page Optional. Max pages. Default 0.
 * @param bool  $echo     Optional. Whether to echo the link. Default true.
 * @return string|void The link URL for next posts page if `$echo = false`.
 */
function next_posts($max_page = 0, $echo = true)
{
    $output = esc_url(get_next_posts_page_link($max_page));
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}

WordPress Version: 4.3

/**
 * Display or return the next posts page link.
 *
 * @since 0.71
 *
 * @param int   $max_page Optional. Max pages.
 * @param bool  $echo     Optional. Echo or return;
 * @return string|void The link URL for next posts page if `$echo = false`.
 */
function next_posts($max_page = 0, $echo = true)
{
    $output = esc_url(get_next_posts_page_link($max_page));
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}

WordPress Version: 4.1

/**
 * Display or return the next posts page link.
 *
 * @since 0.71
 *
 * @param int $max_page Optional. Max pages.
 * @param boolean $echo Optional. Echo or return;
 * @return string The link URL for next posts page if `$echo = false`.
 */
function next_posts($max_page = 0, $echo = true)
{
    $output = esc_url(get_next_posts_page_link($max_page));
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}

WordPress Version: 3.7

/**
 * Display or return the next posts page link.
 *
 * @since 0.71
 *
 * @param int $max_page Optional. Max pages.
 * @param boolean $echo Optional. Echo or return;
 */
function next_posts($max_page = 0, $echo = true)
{
    $output = esc_url(get_next_posts_page_link($max_page));
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}