[wp-hackers] What does user_can really check?

Kevin Newman CaptainN at unFocus.com
Tue Nov 22 23:04:07 UTC 2011


I wrote a plugin to prune users, and one of the checks I do is this:

user_can( $user->ID, 'subscriber')

It worked for my case, but I'm concerned that it may be too broad for 
general use. That does not return true for other roles - like 
contributor and admin - but the question is, would it return true for 
modified "subscribers" or does changing a user's capabilities 
automatically make them fail this check?

thanks,

Kevin N.

P.S. Here is it the plugin:
https://github.com/unFocus/Prune-Users/blob/master/unfocus-prune.php




More information about the wp-hackers mailing list