wppaste
WordPress

apply_filters( "{$adjacent}_post_link", string $output, string $format, string $link, WP_Post|string $post, string $adjacent )

Since
2.6.0, 4.2.0
Filters the adjacent post link.

Description

The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, 'next' or 'previous'. Possible hook names include: <ul> <li>next_post_link</li> <li>previous_post_link</li> </ul>

Parameters

$outputstring
The adjacent post link.
$formatstring
Link anchor format.
$postWP_Post|string
The adjacent post. Empty string if no corresponding post exists.
$adjacentstring
Whether the post is previous or next.

Fired at · 1

  • wp-includes/link-template.php:2397get_adjacent_post_link()

Source

	 * @param string         $output   The adjacent post link.	 * @param string         $format   Link anchor format.	 * @param string         $link     Link permalink format.	 * @param WP_Post|string $post     The adjacent post. Empty string if no corresponding post exists.	 * @param string         $adjacent Whether the post is previous or next.	 */	return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent );} /** * Displays the adjacent post link. * * Can be either next post link or previous.

History

Introduced in 2.6.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.

4.2.0
Added the $adjacent parameter.from the docblock
2.6.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, 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.