(adjacent)_post_link filter-hookWP 2.6.0

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:


add_filter( '(adjacent)_post_link', 'wp_kama_adjacent_post_link_filter', 10, 5 );

 * Function for `(adjacent)_post_link` filter-hook.
 * @param string  $output   The adjacent post link.
 * @param string  $format   Link anchor format.
 * @param string  $link     Link permalink format.
 * @param WP_Post $post     The adjacent post.
 * @param string  $adjacent Whether the post is previous or next.
 * @return string
function wp_kama_adjacent_post_link_filter( $output, $format, $link, $post, $adjacent ){

	// filter...
	return $output;
The adjacent post link.
Link anchor format.
Link permalink format.
The adjacent post.
Whether the post is previous or next.


Since 2.6.0 Introduced.
Since 4.2.0 Added the $adjacent parameter.

Where the hook is called

wp-includes/link-template.php 2316
return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent );

Where the hook is used in WordPress

wp-includes/class-wp-customize-manager.php 1935
add_filter( 'get_edit_post_link', '__return_empty_string' );