[wp-hackers] current_user_can

Robert Lusby nanogwp at gmail.com
Mon Jun 4 13:30:00 UTC 2012


I've seen the following in several plugins, and sure I've seen it in 
core code somewhere:

if (current_user_can('edit_user', $current_user->ID)) {
     //do something
}

Is this valid? A look at the current_user_can function seems to suggest 
there isn't a second argument to that function. There also doesn't seem 
to be an 'edit_user' capability listed, only 'edit_users' (plural).

Considering I've seen this used, and it seems to be returning true/false 
appropriately am I missing something?

Rob.



More information about the wp-hackers mailing list