Hi, I’d like to set a default image field for a field group conditionally on the value of another field in the group. We have a list of map markers as images that we pull into a map and want to dynamically change the marker depending on an ACF field. I don’t think this can be done on the front-end via the conditional part of the field, and I can’t see a way to set the default image? Does anyone know how I’d do this in the ACF interface or would it need code?
Thanks,
David
You can set the default value of an image field using an acf/prepare_field filter.
$field['default_value'] = $attachment_id;