检索格式化为字符串的帖子的标记。
原型
get_the_tag_list( string $before = '', string $sep = '', string $after = '', int $id )
参数
$before
(string)
(Optional)
在标签之前。
$sep
(string)
(Optional)
标签之间。
$after
(string)
(Optional)
标签后。
$id
(int)
(Optional)
帖子ID。默认为当前帖子。
返回值
(string|false|WP_Error)
成功时的标签列表,如果没有条款,则为false
源文件
路径:wp-includes/category-template.php
<?php
...
function get_the_tag_list( $before = '', $sep = '', $after = '', $id = 0 ) {
/**
* Filters the tags list for a given post.
*
* @since 2.3.0
*
* @param string $tag_list List of tags.
* @param string $before String to use before tags.
* @param string $sep String to use between the tags.
* @param string $after String to use after tags.
* @param int $id Post ID.
*/
return apply_filters( 'the_tags', get_the_term_list( $id, 'post_tag', $before, $sep, $after ), $before, $sep, $after, $id );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/get_the_tag_list/