Support

Account

Home Forums ACF PRO Populate choices to conditional logic

Solving

Populate choices to conditional logic

  • Hi !
    I have a question about populating choices in the admin part of ACF.
    For now I know how to populate choices to selection fields with acf/load_field.
    I got an options page in which I want my users make some choices and I want these choices affect the way fields are displayed or not in another group.
    So here is my question : is there a way to populate these choices in order to activate conditional logic in another group ?

    Thanks a lot for any thoughts or insights.

  • Yes, you can populate conditional logic, and you can even make it work across field groups, using the acf/load_field filter https://www.advancedcustomfields.com/resources/acf-load_field/

    The best advice I can give you is to create a field group that has a select field with some example choices and some other fields that are conditional on those choices an then export that group to PHP to see what the settings are.

    This cannot be done across field groups in the ACF admin, but it can be done with the acf/load_field filter because the conditional login is based on the field key. Your conditional logic will work as long as that field key is on the page. However, you must make sure it’s on the page because otherwise you might trigger some JS errors if ACF tries to find a field that does not exist.

  • Despite there’s no conditional logic yet on image select, I don’t figure out how I can set the conditional logic with acf-load-field.
    Do you have any example ?

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

You must be logged in to reply to this topic.

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.