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

WordPress Trac noreply at wordpress.org
Wed Nov 28 23:14:31 UTC 2012


#22624: New current_user_has_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 SergeyBiryukov):

 Replying to [comment:2 sc0ttkclark]:
 > Right, in the case of Multisite, this function would return true only if
 the user was that specific role.

 From my testing, it's vice versa, that's only the case on single site.

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

 Looking at the page history, seems that the sentence was also added
 because of #20824.

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


More information about the wp-trac mailing list