[wp-trac] [WordPress Trac] #16617: Bulk activate plugins: add capabilities with WP_Roles::add_cap() fails, while procedural add_cap() does not

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 23 21:19:56 UTC 2011


#16617: Bulk activate plugins: add capabilities with WP_Roles::add_cap() fails,
while procedural add_cap() does not
-----------------------------+------------------------------
 Reporter:  jrfoell          |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Role/Capability  |     Version:  3.0.5
 Severity:  normal           |  Resolution:
 Keywords:  close            |
-----------------------------+------------------------------

Comment (by jrfoell):

 I see your point... short of convincing the team to change to a singleton
 or a static method, I will use your recommended method.

 Maybe a static method would be considered for the WP_Roles?
 WP_Roles::get_roles( $role ) could be changed to instantiate itself if
 need be (essentially what get_role does now).  I attached a patch that
 shows how it could work... but it does little in the way of improvement
 because the get_roles() function needs to remain for backwards-
 compatibility.  At least encouraging people to use WP_Roles::get_roles
 would make it obvious that the code is in the WordPress namespace.  You
 may otherwise close this ticket.

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


More information about the wp-trac mailing list