WordPress开发者和主题制作者的搜索引擎



get_the_tags ›

Since2.3.0
已弃用n/a
get_the_tags ( $id = 0 )
参数:
  • (int) $id Post ID.
    Required: No
    默认:
返回:
  • (array|false|WP_Error) Array of tag objects on success, false on failure.
定义在:
文档:

Retrieve the tags for a post.



源码

function get_the_tags( $id = 0 ) {

	/**
	 * Filters the array of tags for the given post.
	 *
	 * @since 2.3.0
	 *
	 * @see get_the_terms()
	 *
	 * @param WP_Term[] $terms An array of tags for the given post.
	 */
	return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag' ) );
}