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 badges1 Answer
Reset to default 0Wow, 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?