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 setting custom user fields.
This method does not update custom fields in the database. It only stores the value on the WP_User instance.
(string) (Required) User meta key.
(mixed) (Required) User meta value.
File: wp-includes/class-wp-user.php
public function __set( $key, $value ) {
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>'
)
);
$this->ID = $value;
return;
}
$this->data->$key = $value;
} | Version | Description |
|---|---|
| 3.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_user/__set