显示与当前帖子相邻的下一个帖子链接。
原型
next_post_link( string $format = '%link »', string $link = '%title', bool $in_same_term = false, array|string $excluded_terms = '', string $taxonomy = 'category' )
参数
$format
(string)
(Optional)
链接锚格式。默认’«%link’。
$link
(string)
(Optional)
链接永久链接格式。默认’%title’
$in_same_term
(bool)
(Optional)
链接是否应该在同一分类术语中。
$excluded_terms
(array|string)
(Optional)
排除的术语ID的数组或逗号分隔列表。
$taxonomy
(string)
(Optional)
分类法,如果$ in_same_term为真。
源文件
路径:wp-includes/link-template.php
<?php
...
function next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/next_post_link/