[wp-hackers] Removing built in roles

Jeremy Clarke jer at simianuprising.com
Mon May 14 21:33:10 UTC 2012


On Tue, May 8, 2012 at 12:17 PM, Robert Lusby <nanogwp at gmail.com> wrote:

>
> Does anyone know of any issues using remove_role on built in roles?
>
>
You'd definitely want to make sure that absolutely no user has one of the
roles you are deleting, as well as checking that the default role was one
of your newly created ones.

You will also run into issues with any plugins that assume roles rather
than capabilities when doing checks. I'd recommend keeping the
administrator role for the admin user just in case.


> If this may cause problems - is there a way to just "hide" the roles...
>
>
You'd probably want to filter the get_editable_roles() call
('editable_roles' filter). That will stop the unwanted roles from showing
up in wp_dropdown_roles() etc. without completely erasing them out of the
system (which is probably better than removing them completely just in
case).



More information about the wp-hackers mailing list