{$adjacent}_post_link WordPress Filter Hook

The {$adjacent}_post_link hook is used to create links to the next or previous post, depending on the value of $adjacent.

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

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:

  • next_post_link
  • previous_post_link

Top ↑

Parameters

$output

(string)The adjacent post link.

$format

(string)Link anchor format.

$link

(string)Link permalink format.

$post

(WP_Post)The adjacent post.

$adjacent

(string)Whether the post is previous or next.


Top ↑

Source

File: wp-includes/link-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.2.0Added the $adjacent parameter.
2.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More