最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Relate term to term?

programmeradmin2浏览0评论

How can I set a relationship between two taxonomy terms (each of a different taxonomy)?

So, relate a "person" term "John Doe" with a "company" term "Acme Inc"?

How can I set a relationship between two taxonomy terms (each of a different taxonomy)?

So, relate a "person" term "John Doe" with a "company" term "Acme Inc"?

Share Improve this question asked May 9, 2020 at 7:42 Robert AndrewsRobert Andrews 9881 gold badge19 silver badges42 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Wow, it just works... I can use wp_set_object_terms() to set a term to a term...

$term_taxonomy_ids = wp_set_object_terms( $bill_term_id, $microsoft_term_id, 'company' );

And I can retrieve the company connected to a person with wp_get_object_terms like...

$bills_company_terms = wp_get_object_terms($bill_term_id, 'company');

The only thing is, how can I put a backend interface on these relationships?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论