Home › Forums › Backend Issues (wp-admin) › How to dynamically set specific field read only › Reply To: How to dynamically set specific field read only
Hi —
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.