wp_revoke_user() WordPress Function
The wp_revoke_user() function is used to revoke a user's access to a WordPress site. This function can be used to revoke a user's access to a specific site or to revoke a user's access to all sites in a WordPress network.
wp_revoke_user( int $id ) #
Remove all capabilities from user.
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(); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |