Can I modify the profile form?

Can I modify the profile form?

by Brendan Anderson -
Number of replies: 2

I developed a local plugin that syncs certain profile data from an external service. For instance "Institution". If a user edits their profile and updated Institution, their changes will be overwritten the next time the profile data is synced.

This is all fine. But I would prefer it if the user could not edit the field at all, maybe with a message about why.

I have a workable solution where I make the fields read only using javascript in my theme. But I would prefer a solution that:

  1. Is not javascript dependent
  2. Lives with my local plugin. After all, it's the plugin that knows which fields are synced, not my theme.


Any ideas? Is it possible to modify profile form markup? Specifically from a local plugin?

Average of ratings: -
In reply to Brendan Anderson

Re: Can I modify the profile form?

by Kevin Wiliarty -

Hi Brendan,

Each auth plugin (e.g. auth_manual, auth_ldap, etc.) has the ability to lock any profile field. The values are saved in the <prefix_>config_plugins table as 'field_lock_institution', etc. Each user has an auth method, and if that method locks the field, then that user will not be able to edit it. I imagine you could do something with that table.

Average of ratings: Useful (1)
In reply to Kevin Wiliarty

Re: Can I modify the profile form?

by Brendan Anderson -

Kevin, not only can this be done from an auth module. It is an available setting in the auth module that I use. I just had to look.


Thanks!