I have found that setting readonly to 1 works for text fields, but not for fields of other types — if there’s a widget, the widget still functions (*and* changed values are saved). In my case I have both a select of users and a radio dialog box.
Currently I am getting around this by converting each field to a text field in the load_field filter, plus setting it to readonly.
But this feels very hacky and fragile — I already ran into a problem where I had switched between saving the label or the value of a choice and it broke.
So I would like to add my vote for official support of the ability to dynamically set a field to readonly, and have that work for widgets as well.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.