wp_get_post_tags 获取文章标签
使用方法;
<?php wp_get_post_tags( $post_id, $args ) ?>
$post_id为$post->ID
$args 为设定返回值,默认全部返回,该参数wp_get_object_terms最后一个参数的设定
可以使用如下参数
Argument Options
The following information has to do with the
$argsparameter and for what can be contained in the string or array of that parameter, if it exists.
- order
- (string)
- ASC - Default
- DESC
- orderby
- (string)
- name - Default
- count
- slug
- term_group
- term_order
- term_id
- none
- fields
- (string)
- all - Default : all matching term's objects will be returned
- ids : term's ids will be returned
- names : term's names will be returned
- slugs : term's slugs will be returned
- all_with_object_id : all matching term's objects will be returned
- tt_ids : term's taxonomy's ids will be returned
最后更新于 2017-03-17 15:58:08 并被添加「」标签,已有 641 位童鞋阅读过。
此处评论已关闭