Removes a role, if it exists.
Parameters
$role
stringrequired- Role name.
Source
function remove_role( $role ) {
wp_roles()->remove_role( $role );
}
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |
Removes a role, if it exists.
$role
stringrequiredfunction remove_role( $role ) {
wp_roles()->remove_role( $role );
}
Version | Description |
---|---|
2.0.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
Example
Remove the ‘subscriber’ role if it exists.