Read-only Field for Specific User Role
-
How can I make cmb2 metaboxes or specific fields “read-only” for specific user roles?
Presently with this function `$cmb->add_field( array(
‘name’ => ‘Read Only’,
‘description’ => ‘The value of this input should be saved somewhere else.’,
‘id’ => ‘_jtcmb2_readonly’,
‘type’ => ‘text’,
‘save_field’ => false, // Otherwise CMB2 will end up removing the value.
‘attributes’ => array(
‘readonly’ => ‘readonly’,
‘disabled’ => ‘disabled’,
),
) );`
I can make a field read-only and this will be for all users.
How can I make all fields in a metabox or specific fields read-only for specific user roles?
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Read-only Field for Specific User Role’ is closed to new replies.