Home Forums Feature Requests Allow for conditional on more fields in php


Allow for conditional on more fields in php

  • I have a site that requires some pretty custom dynamic field values. I have a page that needs to show posts from a specific category (with filters added for meta values like “featured post”). I want the user to select a category using the built in taxonomy field type. Then I want to prepopulate a repeater that has a single select box that shows featured posts from the category they chose. Currently, conditional logic only allows for conditions on select, radio, checkbox fields. So, I had to register the field in php as a select and prepopulate the first “category” select using a get_terms call instead of the built in taxonomy field (which is prettier). That way I could use the conditional logic to show a field group based on that choice.

    I would like to request that you extend the conditional logic to other field types. That way, when I use php to register those field groups, I can be more dynamic in my creation of field groups. I think this functionality extends to tons of other possible scenarios (especially flexible content fields) and would be useful in far more cases than just my current one.

  • Hi @jrwdev

    I will create a feature request for extending the conditional logic to other fields in the Github repo. I don’t think it’s as easy of fix as one would want as it probably requires some special event targeting depending on what field type it is etc. So it might not come in a closer update.

    That’s a nice solution tho for the time being. Very creative 🙂

  • Hi @jrwdev

    So a bit of update. Elliot thought it was a good idea and actually not that hard to implement so you might get to see this in a near future update 🙂

  • I would also like to see this option available!

  • I’ve needed this as well, so I created a custom field setting which allows for conditional logic based on taxonomy. Give it a try when you get a chance.

    ACF Conditional Logic Advanced

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Allow for conditional on more fields in php’ is closed to new replies.