Hide profile fields from editing for specific users
I have a corporate Intranet running on WordPress 4.9.8 and BuddyPress 3.1.0
I have specific xprofile fields that I’d like only editable to people who have the “Edit Users” capability.
I’ve seen snippets of code here or there that almost do what I’m looking for but everything I’ve found is old and out of date.
Could someone help me with this.
Basically I need the PHP equivalent of
If we’re on the edit BuddyPress profile page AND user does not have the “edit users” capability then hide profile fields with X id(s).
I’d also be happy with specifying a role instead of capability as long as I can specify multiple role ids.
Thank you in advance.
- You must be logged in to reply to this topic.