WP_User::__unset( string $key )
Magic method for unsetting a certain custom field.
Description Description
Parameters Parameters
- $key
-
(string) (Required) User meta key to unset.
Source Source
File: wp-includes/class-wp-user.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 ] ); } }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |