src/Capabilities_Command.php
public function remove( $args ) {
		self::persistence_check();

		$role = array_shift( $args );

		$role_obj = self::get_role( $role );

		$count = 0;

		foreach ( $args as $cap ) {
			if ( ! isset( $role_obj->capabilities[ $cap ] ) ) {
				continue;
			}

			$role_obj->remove_cap( $cap );

			$count++;
		}

		$capability = WP_CLI\Utils\pluralize( 'capability', $count );

		WP_CLI::success( "Removed {$count} {$capability} from '{$role}' role." );
	}
public function remove( $args ) {
		self::persistence_check();

		$role = array_shift( $args );

		$role_obj = self::get_role( $role );

		$count = 0;

		foreach ( $args as $cap ) {
			if ( ! isset( $role_obj->capabilities[ $cap ] ) ) {
				continue;
			}

			$role_obj->remove_cap( $cap );

			$count++;
		}

		$capability = WP_CLI\Utils\pluralize( 'capability', $count );

		WP_CLI::success( "Removed {$count} {$capability} from '{$role}' role." );
	}
public function remove ( $ args ) { self :: persistence_check ( ) ; $ role = array_shift ( $ args ) ; $ role_obj = self :: get_role ( $ role ) ; $ count = 0 ; foreach ( $ args as $ cap ) { if ( ! isset ( $ role_obj -> capabilities [ $ cap ] ) ) { continue ; } $ role_obj -> remove_cap ( $ cap ) ; $ count ++ ; } $ capability = WP_CLI \ Utils \ pluralize ( 'capability' , $ count ) ; WP_CLI :: success ( "Removed {$count} {$capability} from '{$role}' role." ) ; }
Removes capabilities from a given role.

## OPTIONS

<role>
: Key for the role.

<cap>...
: One or more capabilities to remove.

## EXAMPLES

# Remove 'spectate' capability from 'author' role.
$ wp cap remove author spectate
Success: Removed 1 capability from 'author' role.
Removes capabilities from a given role .