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

Filters the adjacent post link.


The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, ‘next’ or ‘previous’.

Possible hook names include:

  • next_post_link
  • previous_post_link

Top ↑


$output string
The adjacent post link.
$format string
Link anchor format.
$link string
Link permalink format.
$post WP_Post|string
The adjacent post. Empty string if no corresponding post exists.
$adjacent string
Whether the post is previous or next.

Top ↑


File: wp-includes/link-template.php. View all references

return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent );

Top ↑


Version Description
4.2.0 Added the $adjacent parameter.
2.6.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.