Reference › Functions get_next_post_link ( string $format = '%link »' , string $link = '%title' , bool $in_same_term = false , int[] | string $excluded_terms = '' , string $taxonomy = 'category' ): string
Since 3.7.0
Source wp-includes/link-template.php:2303Parameters Return Uses Used by Source History Retrieves the next post link that is adjacent to the current post.
Parameters
$formatstring optional Link anchor format. Default '« %link'.Default: '%link »'
$linkstring optional Link permalink format. Default '%title'.Default: '%title'
$in_same_termbool optional Whether link should be in the same taxonomy term. Default false.Default: false
$excluded_termsint[] | stringoptional Array or comma-separated list of excluded term IDs. Default empty.Default: ''
$taxonomystring optional Taxonomy, if $in_same_term is true. Default 'category'.Default: 'category' Return
string The link URL of the next post in relation to the current post. Source View on Trac ↗ View on GitHub ↗
2303 function get_next_post_link ( $format = '%link »' , $link = '%title' , $in_same_term = false , $excluded_terms = '' , $taxonomy = 'category' ) { 2304 return get_adjacent_post_link ( $format , $link , $in_same_term , $excluded_terms , false , $taxonomy ) ; 2305 } History Introduced in 3.7.0 . Unchanged from 6.7.7 through 7.1.0.
6.7.7 6.8.8 6.9.7 7.0.4 7.1.0 Signature, return type and hooks compared across 5 parsed releases.
About this page Parsed data Generated from the wordpress-develop 7.0.4 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.