Add User meta fields, which only admin can edit

Is there a way to add custom user meta fields (like the one in the profile.php, which contains specific user data), but only an admin or an other user with enough capabilities can change them?

Maybe I’m thinking too complicated. How would you tell your site visitors, who from your users is having which position / status without manually updating a static page?

1 Answer
1

I think I get what you are saying, and if not, forgive me:

just add your meta fields / metabox inside:

if( current_user_can( 'administrator' ) ){  // put code here }

*this is assuming you aren’t asking how to add a metafield or metabox.

Leave a Comment