Hello there,
I need to disable ACF advanced fields like : File upload, radio… I’m able to do it for simple fields (input, date…) but no idea to do it for advanced field?
You guys have an idea ? What I want its to restrict user to change the value of those fields.
All my fields are displayed on Back-office. I’m using filter : prepare_field and do my own condition to disabled and readonly fields.
$field['readonly'] = 1;
$field['disabled'] = 1;
thanks you
A radio field can be disabled/readonly by setting it to an array of the values to be disabled
$field['disabled'] = array(
'value 1',
'value 2',
'value 3'
);
As far as I know a file field cannot be disabled or set to readonly in this way. You would probably need to add JavaScript and remove the controls that allow removing and/or adding a file.