WP_Role::remove_cap()
Removes a capability from a role.
Method of the class: WP_Role{}
No Hooks.
Return
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 6.6.1
public function remove_cap( $cap ) { unset( $this->capabilities[ $cap ] ); wp_roles()->remove_cap( $this->name, $cap ); }