/**
* Removes all of the capabilities of the user.
*
* @since 2.1.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*/
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();
} /**
* Returns whether the user has the specified capability.
*
* This function also accepts an ID of an object to check against if the capability is a meta capability. Meta
* capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to
* map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`.
*
* Example usage:
*
* $user->has_cap( 'edit_posts' );
* $user->has_cap( 'edit_post', $post->ID );
* $user->has_cap( 'edit_post_meta', $post->ID, $meta_key );
*
* While checking against a role in place of a capability is supported in part, this practice is discouraged as it
* may produce unreliable results.
*
* @since 2.0.0
* @since 5.3.0 Formalized the existing and already documented `...$args` parameter
* by adding it to the function signature.
*
* @see map_meta_cap()
*
* @param string $cap Capability name.
* @param mixed ...$args Optional further parameters, typically starting with an object ID.
* @return bool Whether the user has the given capability, or, if an object ID is passed, whether the user has
* the given capability for that object.
*/