wp_get_object_terms

过滤钩子
apply_filters( 'wp_get_object_terms', $terms, $object_ids, $taxonomies, $args )
参数
  • (WP_Term[]|int[]|string[]|string) $terms Array of terms or a count thereof as a numeric string.
    Required:
  • (string) $object_ids Comma separated list of object IDs for which terms were retrieved.
    Required:
  • (string) $taxonomies SQL fragment of taxonomy names from which terms were retrieved.
    Required:
  • (array) $args Array of arguments for retrieving terms for the given object(s). See wp_get_object_terms() for details.
    Required:
定义位置
相关勾子
get_object_termswp_get_object_terms_argsset_object_termspre_get_termsget_terms
相关方法
wp_get_object_termswp_set_object_termswp_add_object_termswp_get_post_termswp_remove_object_termsget_objects_in_term
引入
2.8.0
弃用
-

wp_get_object_terms:此函数用于检索与给定对象(例如文章)关联的术语。术语作为 WP_Term 对象的数组返回。

过滤给定对象的术语。

传递给此筛选器的 $taxonomies 参数被格式化为SQL片段。建议使用{@see‘get_object_terms‘}过滤器作为替代。

return apply_filters( 'wp_get_object_terms', $terms, $object_ids, $taxonomies, $args );

常见问题

FAQs
查看更多 >