WordPress at a glance

WP_Roles::remove_cap() WP 1.0

Remove capability from role.

No Hooks.

Return

Nothing (null).

Usage

$WP_Roles = new WP_Roles();
$var = $WP_Roles->remove_cap( $role, $cap );
$role(string) (required)
Role name.
$cap(string) (required)
Capability name.

Code of WP_Roles::remove_cap: wp-includes/class-wp-roles.php VER 4.9.8

<?php
public function remove_cap( $role, $cap ) {
	if ( ! isset( $this->roles[$role] ) )
		return;

	unset( $this->roles[$role]['capabilities'][$cap] );
	if ( $this->use_db )
		update_option( $this->role_key, $this->roles );
}
No comments
    Hello, !     Log In . Register