Hi there,
I’m working on a form where I need to make a specific field either read-only or editable depending on the user’s role.
More specifically, I have a field (e.g., “Department/Service”) that should:
Is there a built-in way (or a recommended custom JavaScript/jQuery or PHP approach) to dynamically change the readonly state of a field based on the user role?
I’m currently using Ultimate Member alongside WordPress roles, so users may have multiple roles assigned (e.g., author, um_gas). Ideally, I would like to check whether the current user has one of the “allowed” roles and, if so, enable the field for editing.
Any suggestions or examples would be much appreciated!
Thanks in advance!