Home » WordPress » How to disable (Read only) acf custom filed in wordpress?

How to disable (Read only) acf custom filed in wordpress?

Using bellow php code you can make ACF custom field as Read only. 

Place bellow PHP code in your theme functions.php file

/**
* Read only input fields in Admin ACF Group
* custom_field_name
*/

function disable_custom_field_name_load_field( $field ) {
$field['readonly'] = 1;
return $field;
}

add_filter('acf/load_field/name=custom_field_name', 'disable_custom_field_name_load_field');

References

Duminda Wijerathna

An all round web designer building websites Over 18 years. Interested in achieving a suitable placement in the field of IT in a growth oriented organization which offers diverse job responsibilities in order to utilize and improve my skills, Knowledge and experience.

Leave a Comment

Your email address will not be published. Required fields are marked *