admin管理员组

文章数量:1429984

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?

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?

Share Improve this question edited Apr 24, 2019 at 19:07 Maxim Zubarev asked May 20, 2011 at 0:44 Maxim ZubarevMaxim Zubarev 3074 silver badges16 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

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.

本文标签: Add User meta fieldswhich only admin can edit