get_the_tags()
get_the_tags( int $id ) 检索帖子的标记。Retrieve the tags for a…
get_the_tags( int $id )
检索帖子的标记。
Retrieve the tags for a post.
检索帖子的标记。
Retrieve the tags for a post.
目录锚点:#参数#返回#源码#笔记
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $id | (int) | 必需 | 邮政编码。 |
返回(Return)
(array|false|WP_Error)成功时标记对象的数组,失败时为false。
源码(Source)
/**
* Retrieve the tags for a post.
*
* @since 2.3.0
*
* @param int $id Post ID.
* @return array|false|WP_Error Array of tag objects on success, false on failure.
*/
function get_the_tags( $id = 0 ) {
/**
* Filter the array of tags for the given post.
*
* @since 2.3.0
*
* @see get_the_terms()
*
* @param array $terms An array of tags for the given post.
*/
return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag' ) );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.3.0 | wp-includes/category-template.php:1131 | 1 function | 3 |
笔记(Notes)
仅打印第一个标记名:
//显示带有链接和自定义分隔符的post标记
此示例打印当前邮件的标记:
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!