Home › Forums › Feature Requests › Taxonomy Terms in Conditional Logic
Please implement the ability to select taxonomy terms in the conditional logic section. My attached illustration will better explain what I’m getting gat.
To be honest, I’m surprised this isn’t already a feature. I firmly believe, though, that implementing this will set ACF worlds apart from its competitors.
You should see taxonomy terms able to be selected like this if you choose Post Taxonomy as the first rule dropdown.
Didn’t work… all that does is give me the option to choose one of the terms.
Ohhhhh, you’re wanting it in conditional logic, not as a location rule on an overall field group. You can definitely assign field groups based on if an item is given a certain taxonomy term so you could say display this set of fields if the taxonomy term for admissions is equal to free or equal to paid. It’s just something that has to be done in separate sets of fields.
Have a look at the attached illustration, please, to better understand what I need to happen. If there is a way to do it, I am pleading with you to help me get to it.
You can create conditional logic based on a taxonomy field, but it is not straight forward. For this you need to know the ID of the term you want the field to appear on. Lets assume that the term ID of “Paid” is 1. In this case your conditional logic rules would be.
Show this field if
Taxonomy Field | Selection is greater than | 0 AND
Taxonomy Field | Selection is less than | 2
That, sir, is very helpful.
Thank you for your input; I shall give it a try.
The only thing I need now is to work out how to get the term IDs…
Not doing great with that…
Go to your taxonomy/term list in the admin. Hover over the link to the term, the URL contains the term ID
John, thank you so much for helping me to solve this ‘puzzle’. I’m very grateful and I’ve learned something new.
Thanks, @hube2 for the answer! It helped me too.
I did find a way to simplify the conditional logic to one condition by selecting “Value is equal to” and entering the taxonomy ID.
Please note that if you have more than one term, you will need to select “Value Contains” instead to make it work.
Applying this to the earlier example, if you want both the FREE and PAID terms to trigger different actions, you have to use “Value Contains”.
You must be logged in to reply to this topic.
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc
— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.