Home › Forums › Backend Issues (wp-admin) › Field Object shows load_field as working, but it doesn't render that way › Reply To: Field Object shows load_field as working, but it doesn't render that way
readonly is not supported by browsers in choice type fields (radio, checkbox, select), so you need to use disabled.
I just did some looking into disabling either a select field or a radio type of field, don’t recall which….
Anyway, my findings were that ACF allows granular control over disabling some fields. Lets say that you have a field with these choices.
value_1 : Value 1 value_2 : Value 2 value_3 : Value 3
You can disable any of these and leave the rest enabled. So if you want to disable value 2 to then do:
$field['disabled'] = array( 'value_2' => true );
I have not tested this on every field type that allows choices and like I said, I don’t remember which field I actually tested this on, all I can say is to give it a try and see what happens.
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.