Code Element Df

Disable ACF Text Field

Use this code snippet to disable an ACF text field in the WordPress admin.

Replace:

field_name: with the name of your ACF text field

/**
* Disable ACF Text Field
*/
add_filter('acf/load_field/name=field_name', function ($field) {
    $field['disabled'] = 1;
    return $field;
});