Home › Forums › Feature Requests › Read-Only Field › Reply To: Read-Only Field
Here is with new stylized True / False checkboxes. Tested and it works.
add_action('acf/render_field_settings/type=text', 'add_readonly_and_disabled_to_text_field');
function add_readonly_and_disabled_to_text_field($field) {
acf_render_field_setting( $field, array(
'label' => __('Read Only?','acf'),
'instructions' => '',
'type' => 'true_false',
'name' => 'readonly',
'ui' => 1,
'class' => 'acf-field-object-true-false-ui'
));
acf_render_field_setting( $field, array(
'label' => __('Disabled?','acf'),
'instructions' => '',
'type' => 'true_false',
'name' => 'disabled',
'ui' => 1,
'class' => 'acf-field-object-true-false-ui',
));
}
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.