remove_role() WordPress Function
This function allows you to remove a role from a user. You can use it to remove any unwanted roles that a user may have.
remove_role( string $role ) #
Removes a role, if it exists.
Parameters
- $role
(string)(Required)Role name.
Source
File: wp-includes/capabilities.php
function remove_role( $role ) { wp_roles()->remove_role( $role ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |