get_previous_post_link

SummerySummery

Retrieves the previous post link that is adjacent to the current post.

Syntax

get_previous_post_link( string $format = '« %link', string $link = '%title', bool $in_same_term = false, array|string $excluded_terms = '', string $taxonomy = 'category' )

ParametersParameters

$format

(string) (Optional) Link anchor format. Default '« %link'.

Default value: '« %link'

$link

(string) (Optional) Link permalink format.

Default value: '%title'

$in_same_term

(bool) (Optional) Whether link should be in a same taxonomy term.

Default value: false

$excluded_terms

(array|string) (Optional) Array or comma-separated list of excluded term IDs.

Default value: ''

$taxonomy

(string) (Optional) Taxonomy, if $in_same_term is true.

Default value: 'category'

ReturnReturn

(string) The link URL of the previous post in relation to the current post.

SourceSource

File: wp-includes/link-template.php


			

ChangelogChangelog

Changelog
Version Description
3.7.0 Introduced.
Scroll to Top