[wp-hackers] After adding custom role, admin panel becomes inaccessible

Andrew Nacin wp at andrewnacin.com
Tue Jun 29 23:40:50 UTC 2010


On Tue, Jun 29, 2010 at 5:49 PM, Alex Hempton-Smith <hempsworth at gmail.com>wrote:

> Would I need to place that hard-coded definition in wp-config or could I
> have it in my plugin file?
> Perhaps hard code it at init?


$wp_user_roles is designed for ALL roles and capabilities, and a complete
bypass of the DB. That means you'd need to keep up with capabilities we add
to core in future releases, etc... (which is something most roles created by
plugins do not take into account). It's not designed for a distributed
plugin, but rather a serious or specialized and well-maintained network,
though I'm not familiar with what you're working on, of course.

Also, WP needs it before init, as it sets up the current user before then.


More information about the wp-hackers mailing list