[wp-trac] [WordPress Trac] #16617: New WP_Roles (was: 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
Sat Jun 4 21:07:53 UTC 2011
#16617: New WP_Roles
-----------------------------+------------------------------
Reporter: jrfoell | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Role/Capability | Version: 3.0.5
Severity: normal | Resolution:
Keywords: has-patch close |
-----------------------------+------------------------------
Changes (by nacin):
* keywords: has-patch => has-patch close
* type: defect (bug) => enhancement
Comment:
WP_Roles is designed to function as a de facto singleton. The global
$wp_roles should hold the only instantiation of the WP_Roles object. While
there might be a use case for instantiating it a second time, it would be
invalid to attempt to do so when trying to modify the roles definition in
the database.
$wp_user_roles exists for a specific reason -- to allows the DB to be
bypassed. The use case is defining the roles definition in, say, wp-
config.php. Good for multisites with custom roles/caps. I think the
attached patch, while might not have any side effects, really isn't how
it's designed.
WP_Roles has never worked the way you've described. I'd think the proper
way to handle this ticket would be to mark as invalid on that basis.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16617#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list