WordPress at a glance
function is not described

WP_User::remove_all_caps() public WP 2.1.0

Remove all of the capabilities of the user.

{} It's a method of the class: WP_User{}

No Hooks.

Return

````. Null. Nothing.

Usage

$WP_User = new WP_User();
$WP_User->remove_all_caps();

Notes

  • Global. wpdb. $wpdb WordPress database abstraction object.

Changelog

Since 2.1.0 Introduced.

Code of WP_User::remove_all_caps() WP 5.7

<?php
public function remove_all_caps() {
	global $wpdb;
	$this->caps = array();
	delete_user_meta( $this->ID, $this->cap_key );
	delete_user_meta( $this->ID, $wpdb->get_blog_prefix() . 'user_level' );
	$this->get_role_caps();
}