[wp-trac] [WordPress Trac] #31304: Add wrapper function to check if a given role exists

WordPress Trac noreply at wordpress.org
Thu Feb 12 08:10:17 UTC 2015


#31304: Add wrapper function to check if a given role exists
-----------------------------+-----------------------------
 Reporter:  hlashbrooke      |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Currently, the only way to check if a user role exists in the database is
 to use `get_role()` and check if the result is `null` or not. While that
 isn't too complicated to do, I think it would be useful to have a simple
 wrapper function that performs this check so that developers can easily
 check for a role before manipulating it (adding capabilities, etc.).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31304>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list