Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

is there a way to add custom user meta fields (like the one in the profile.php which contain 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 doing which work on the site, if there are too many users (and probably often changing work) that it would be impossible too make a static page or something.

Greetings, .wired

// edit: you may replace "work" with position. I want to give the users a specific position. That's not the user role!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.