Uses
| Uses | Description |
|---|---|
| wp-includes/l10n.php: __() | Retrieve the translation of $text. |
| wp-includes/functions.php: _deprecated_argument() | Mark a function argument as deprecated and inform when it has been used. |
Magic method for unsetting a certain custom field.
(string) (Required) User meta key to unset.
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 ] );
}
} | Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_user/__unset