You can do this using an acf/load_field or an acf/prepare_field filter. In either of these functions you can set the conditional logic and base it on any field using the field’s key.
$('[data-key="YOUR FIELD KEY"]').data('conditions', 'JSON ENCODED ARRAY');
Basically, what I do is I create a field group with a similar set of fields and use the export to PHP to see how the conditional logic should look. Then you just have to replace the field key with the key of the field you actually want to use. This can’t be done when building a field, but like I said, any field that exists on the same page will do the trick, even if it is in a different group. Or it did the last time I tried it.
Viewing 4 posts - 1 through 4 (of 4 total)
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