[wp-trac] [WordPress Trac] #22624: New current_user_role function to work for roles like current_user_can does for caps

WordPress Trac noreply at wordpress.org
Wed Nov 28 23:02:42 UTC 2012


#22624: New current_user_role function to work for roles like current_user_can does
for caps
-----------------------------+------------------------------
 Reporter:  sc0ttkclark      |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Users            |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------

Comment (by sc0ttkclark):

 Right, in the case of Multisite, this function would return true only if
 the use was that specific role.

 But via the WP codex itself:
 http://codex.wordpress.org/Function_Reference/current_user_can

 {{{
 Do not pass a role name to current_user_can(), as this is not guaranteed
 to work correctly.
 }}}

 This would also mean if a capability is added that matches the role, there
 won't be confusion within the code as this function would only look at the
 actual roles.

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


More information about the wp-trac mailing list