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"?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityHow 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"?
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?