adjacent_post_link()WP 2.5.0

Displays the adjacent post link.

Can be either next post link or previous.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy );
$format(строка) (обязательный)
Link anchor format.
$link(строка) (обязательный)
Link permalink format.
$in_same_term(true|false)
Whether link should be in the same taxonomy term.
По умолчанию: false
$excluded_terms(int[]|строка)
Array or comma-separated list of excluded category IDs.
По умолчанию: ''
$previous(true|false)
Whether to display link to previous or next post.
По умолчанию: true
$taxonomy(строка)
Taxonomy, if $in_same_term is true.
По умолчанию: 'category'

Список изменений

С версии 2.5.0 Введена.

Код adjacent_post_link() WP 6.5.2

function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
	echo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy );
}