WP_Role::remove_cap
Removes a capability from a role.
Method of the class: WP_Role{}
No Hooks.
Returns
null. Nothing (null).
Usage
global $wp_role; $wp_role->remove_cap( $cap );
- $cap(string) (required)
- Capability name.
Changelog
| Since 2.0.0 | Introduced. |
WP_Role::remove_cap() WP Role::remove cap code WP 7.0
public function remove_cap( $cap ) {
unset( $this->capabilities[ $cap ] );
wp_roles()->remove_cap( $this->name, $cap );
}