wppaste
WordPress

adjacent_post_link( string $format, string $link, bool $in_same_term = false, int[]|string $excluded_terms = '', bool $previous = true, string $taxonomy = 'category' )

Since
2.5.0
Source
wp-includes/link-template.php:2408
Displays the adjacent post link.

Description

Can be either next post link or previous.

Parameters

$formatstring
Link anchor format.
$in_same_termbooloptional
Whether link should be in the same taxonomy term. Default false.Default: false
$excluded_termsint[]|stringoptional
Array or comma-separated list of excluded category IDs. Default empty.Default: ''
$previousbooloptional
Whether to display link to previous or next post. Default true.Default: true
$taxonomystringoptional
Taxonomy, if $in_same_term is true. Default 'category'.Default: 'category'

Uses · 1

Source

function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {	echo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy );}

History

Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

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.