Home Forums Feature Requests Feature Request: Hidden / Disabled Field Type Reply To: Feature Request: Hidden / Disabled Field Type

  • readonly and hidden fields are not in the scope of what I built my plugin for. I also feel that the settings for such a thing would become unwieldy. Imagine checkboxes for every user role (edit, readonly, disabled), or even a radio field. I think this would over-complicate the setting and makes it less useful.

    Hidden fields are extremely difficult in ACF because there isn’t a way to provide hidden fields, and as I stated in the plugin, there is no security in hidden fields and I find them a useless endeavor. The only purpose that a hidden field serves would be if the value is needed for some type of javascript that you want to perform and if this is the case then this purpose would be better served by localizing your script with the values you’ll need.

    To turn this back to the subject of ACF itself rather than my plugin let’s talk about displaying a field so it can be read but not edited…

    Read only fields, as you are talking about, would have to be done with a completely different mechanism. I think this could be done by using an acf/load_field filter and converting the field from whatever type of field it is into a message field, taking the values of the field and converting them to a message. I’m not even sure if this is possible or if it would somehow effect the values saved by ACF. But then this could also be accomplished by having a standard ACF message field that is conditional on the user type and then using an acf/load_field filter to set the message in a similar fashion by getting the message from the value of the field that you want to display.