[wp-trac] [WordPress Trac] #20824: current_user_can() bug with Super Admin

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 4 11:21:36 UTC 2012


#20824: current_user_can() bug with Super Admin
--------------------------------+----------------------
 Reporter:  abdessamad idrissi  |       Owner:
     Type:  defect (bug)        |      Status:  closed
 Priority:  normal              |   Milestone:
Component:  Users               |     Version:  3.3.2
 Severity:  normal              |  Resolution:  invalid
 Keywords:                      |
--------------------------------+----------------------
Changes (by scribu):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 You should not pass role names to `current_user_can()`, only capabilities.

 Also, the only way to test for super-admins is by using is_super_admin().

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20824#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list