next_post_link

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

WordPress Version: 6.2

/**
 * Displays the next post link that is adjacent to the current post.
 *
 * @since 1.5.0
 *
 * @see get_next_post_link()
 *
 * @param string       $format         Optional. Link anchor format. Default '« %link'.
 * @param string       $link           Optional. Link permalink format. Default '%title'.
 * @param bool         $in_same_term   Optional. Whether link should be in the same taxonomy term.
 *                                     Default false.
 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
 *                                     Default empty.
 * @param string       $taxonomy       Optional. Taxonomy, if `$in_same_term` is true. Default 'category'.
 */
function next_post_link($format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category')
{
    echo get_next_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
}

WordPress Version: 5.7

/**
 * Displays the next post link that is adjacent to the current post.
 *
 * @since 1.5.0
 *
 * @see get_next_post_link()
 *
 * @param string       $format         Optional. Link anchor format. Default '« %link'.
 * @param string       $link           Optional. Link permalink format. Default '%title'
 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
 * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
 */
function next_post_link($format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category')
{
    echo get_next_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
}

WordPress Version: 5.5

/**
 * Displays the next post link that is adjacent to the current post.
 *
 * @since 1.5.0
 *
 * @see get_next_post_link()
 *
 * @param string       $format         Optional. Link anchor format. Default '« %link'.
 * @param string       $link           Optional. Link permalink format. Default '%title'
 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
 */
function next_post_link($format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category')
{
    echo get_next_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
}

WordPress Version: 4.6

/**
 * Displays the next post link that is adjacent to the current post.
 *
 * @since 1.5.0
 * @see get_next_post_link()
 *
 * @param string       $format         Optional. Link anchor format. Default '« %link'.
 * @param string       $link           Optional. Link permalink format. Default '%title'
 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term. Default false.
 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty.
 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
 */
function next_post_link($format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category')
{
    echo get_next_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
}

WordPress Version: 4.0

/**
 * Display next post link that is adjacent to the current post.
 *
 * @since 1.5.0
 * @see get_next_post_link()
 *
 * @param string       $format         Optional. Link anchor format.
 * @param string       $link           Optional. Link permalink format.
 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
 */
function next_post_link($format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category')
{
    echo get_next_post_link($format, $link, $in_same_term, $excluded_terms, $taxonomy);
}

WordPress Version: 3.8

/**
 * Display next post link that is adjacent to the current post.
 *
 * @since 1.5.0
 * @see get_next_post_link()
 *
 * @param string       $format         Optional. Link anchor format.
 * @param string       $link           Optional. Link permalink format.
 * @param bool         $in_same_term   Optional. Whether link should be in a same taxonomy term.
 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs.
 * @param string       $taxonomy       Optional. Taxonomy, if $in_same_term is true. Default 'category'.
 */
function next_post_link($format = '%link »', $link = '%title', $in_same_cat = false, $excluded_terms = '', $taxonomy = 'category')
{
    echo get_next_post_link($format, $link, $in_same_cat, $excluded_terms, $taxonomy);
}

WordPress Version: 3.7

/**
 * Display next post link that is adjacent to the current post.
 *
 * @since 1.5.0
 *
 * @param string $format Optional. Link anchor format.
 * @param string $link Optional. Link permalink format.
 * @param bool $in_same_cat Optional. Whether link should be in a same category.
 * @param array|string $excluded_categories Optional. Array or comma-separated list of excluded category IDs.
 */
function next_post_link($format = '%link »', $link = '%title', $in_same_cat = false, $excluded_categories = '')
{
    echo get_next_post_link($format, $link, $in_same_cat, $excluded_categories);
}