WP_Role::remove_cap()publicWP 2.0.0

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() code WP 6.5.2

public function remove_cap( $cap ) {
	unset( $this->capabilities[ $cap ] );
	wp_roles()->remove_cap( $this->name, $cap );
}