wp_revoke_user

Remove all capabilities from user.

Description

wp_revoke_user( (int) $id ); 

Parameters (1)

0. $id (int)
User ID.

Usage

  1. if ( !function_exists( 'wp_revoke_user' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/user.php'; 
  3.  
  4. // User ID. 
  5. $id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_revoke_user($id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/user.php  
  1. function wp_revoke_user($id) { 
  2. $id = (int) $id; 
  3.  
  4. $user = new WP_User($id); 
  5. $user->remove_all_caps();