[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 22:11:49 UTC 2012
#22624: New current_user_role function to work for roles like current_user_can does
for caps
-----------------------------+-----------------------------
Reporter: sc0ttkclark | Type: feature request
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Users
Version: | Severity: normal
Keywords: |
-----------------------------+-----------------------------
current_user_can( 'capability' ) is great, but it would save some code and
be more reliable if we had something like this for roles as a global
function that's easy to get at:
current_user_role( 'editor' ) would return true if the user has the editor
role, false if they weren't.
I'll work on a patch for this when I get a moment, this is just here to
remind me and let others know what I'm thinking.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22624>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list