Home › Forums › General Issues › Re-using fields in different groups? Can they simply have the same name? › Reply To: Re-using fields in different groups? Can they simply have the same name?
It is possible to achieve this without created multiple field groups and multiple fields of the same name.
The best, easiest why to achieve this is.
1) Instead of using the default meta boxes for assigning taxonomy terms to post you use an ACF taxonomy field in the field group.
You remove the taxonomy metabox in WP by setting the “meta_box_cb” argument to false.
In the ACF taxonomy field you turn on both the “Load Terms” and the “Save Terms” options.
2) For all of the other fields you use conditional logic to determine if a field should be shown based on the taxonomy field.
This can be a little difficult using the ACF native conditional logic because you have to check if the term ID is > or < a given value.
Conditional logic can be extended if you want to be able to choose terms, this has been done but I don’t have any specific examples to point you to.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.