I have a custom taxonomy A with some terms (A1, A2,A3, etc) and a second custom taxonomy B. I want to create a custom field in taxnomony B which will be a dropdown menu with the terms from taxonomy A. I am able to create custom fields with texts and to get the terms from taxonomy A with get_terms(). The get_terms() function, returns an array of object (every object is a term). I am not sure how to build the dropdwon. How can I connect them? (I want to do it programmatically so that I can use the code for more than one sites) Thank you
Instead of showing custom field with text, create a custom field with select dropdown.
Populate that dropdown options with get_terms function (term_id as value)
Add multiple attribute to select if you need to store more than one term relation.
Store values as array of term ids
On frontend loop trough saved array and use get_term function to get term object data.
p.s. on 4) you should check if saved term id exists, if not then you should take care of it (delete the relation or ignore on loop I guess)