W3cubDocs

/WordPress

wp_revoke_user( int $id )

Remove all capabilities from user.

Description

Parameters

$id

(int) (Required) User ID.

Source

File: wp-admin/includes/user.php

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

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

Changelog

Version Description
2.1.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_revoke_user