Support

Account

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.