Create an ACF field that this field can be conditional on, for example a radio field that has all the possible values in it.
Set your conditional fields
Create an acf/prepeare_field filter that sets the value of this radio field base
Use custom CSS to hide this field on the edit page so that users cannot change the values.
$('your field selector').trigger('change');
More complicated, but possible would be to build your own conditional logic script that detects this the change and then manipulates the class of the field you want to be conditional, this requires adding or removing the class ‘hidden-by-conditional-logic’ to the field container.
Overall, the easiest way is to have multiple field groups that have locations setting set appropriately and this is what I shoot for unless there is some requirement that dictates otherwise.
Viewing 2 posts - 1 through 2 (of 2 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