adjacent_post_link() - WordPress 函数参考中文文档

返回介绍

adjacent_post_link()

发布于 2017-09-10 字数1955 浏览 1140 评论 0

adjacent_post_link( string $format,  string $link,  bool $in_same_term = false,  array|string $excluded_terms = '',  bool $previous = true,  string $taxonomy = 'category' )

Displays the adjacent post link.


描述

Can be either next post link or previous.


参数

$format

(string)
(Required)
Link anchor format.

$link

(string)
(Required)
Link permalink format.

$in_same_term

(bool)
(Optional)
Whether link should be in a same taxonomy term.

Default value: false

$excluded_terms

(array|string)
(Optional)
Array or comma-separated list of excluded category IDs.

Default value: ”

$previous

(bool)
(Optional)
Whether to display link to previous or next post.

Default value: true

$taxonomy

(string)
(Optional)
Taxonomy, if $in_same_term is true.

Default value: ‘category’


源代码

File: wp-includes/link-template.php

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 );
}

更新日志

Version 描述
2.5.0 Introduced.

相关函数

Uses

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

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!