• Im looking for a way to set my website up so that only administrators can edit anything under “Name” for users (that includes, Username, First Name, Last Name, Nickname, and Display name publicly as).

    Ideally those fields would just be grayed out for non-administrators.

    Any thoughts?

Viewing 1 replies (of 1 total)
  • You could use the admin_footer hook to add some JS that disables these fields. However, this won’t be 100% reliable – anyone savvy enough could manually re-enable these fields using their browser’s built-in element inspection tool.

    To be 100% reliable, I suppose you could hook into profile_update. Technically, the user’s info has already been updated at this point but the hook function receives both the old and new user object, so you could check the user’s role/capabilities and revert any name-related changes if/as needed.

Viewing 1 replies (of 1 total)

The topic ‘Dont allow users to edit "Name"’ is closed to new replies.