WordPress at a glance
function is not described

WP_User::__unset() public WP 4.4.0

Magic method for unsetting a certain custom field.

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

No Hooks.

Return

````. Null. Nothing.

Usage

$WP_User = new WP_User();
$WP_User->__unset( $key );
$key(string) (required)
User meta key to unset.

Changelog

Since 4.4.0 Introduced.

Code of WP_User::__unset() WP 5.7

<?php
public function __unset( $key ) {
	if ( 'id' === $key ) {
		_deprecated_argument(
			'WP_User->id',
			'2.1.0',
			sprintf(
				/* translators: %s: WP_User->ID */
				__( 'Use %s instead.' ),
				'<code>WP_User->ID</code>'
			)
		);
	}

	if ( isset( $this->data->$key ) ) {
		unset( $this->data->$key );
	}

	if ( isset( self::$back_compat_keys[ $key ] ) ) {
		unset( self::$back_compat_keys[ $key ] );
	}
}