wp_revoke_user()WP 2.1.0

Remove all capabilities from user.

No Hooks.

Return

null. Nothing (null).

Usage

wp_revoke_user( $id );
$id(int) (required)
User ID.

Changelog

Since 2.1.0 Introduced.

wp_revoke_user() code WP 6.5.2

function wp_revoke_user( $id ) {
	$id = (int) $id;

	$user = new WP_User( $id );
	$user->remove_all_caps();
}