get_the_tags
apply_filters( ‘get_the_tags’, WP_Term[] $terms )
过滤器::过滤给定post的标记数组。
Filter Hook: Filters the array of tags for the given post.
说明(Description)
另见
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$terms | (WP_Term[]) | 给定帖子的标记数组。 |
源码(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:1142 | 1 | 0 |
get_the_tags 为WP2原创文章,链接:https://www.wp2.cn/hook/get_the_tags-2/