[wp-hackers] Capabilities and Plugins
Owen Winkler
ringmaster at midnightcircus.com
Sun Mar 5 14:11:02 GMT 2006
Mark Jaquith wrote:
> Or, create a new function that allows plugins to register their
> capabilities (in memory). Then, a role manager plugin could merge
> capabilities defined in the database with default capabilities plus
> capabilities registered by plugins on the fly.
In my Role Manager, I have added a hook that allows plugins to register
their own caps for application to roles and users. This is from the
Role Manager documentation (http://redalt.com/wiki/Role+Manager):
add_filter('capabilities_list', 'add_my_caps');
function add_my_caps($caps) {
$caps[] = 'my_custom_cap1';
$caps[] = 'my_custom_cap2';
return $caps;
}
If the core were to do this, it would need to fill the caps list with
all of the built-in caps.
Owen
More information about the wp-hackers
mailing list