diff --git a/wp-includes/class-wp-user.php b/wp-includes/class-wp-user.php index 5d57a996ff..4c206c25fd 100644 --- a/wp-includes/class-wp-user.php +++ b/wp-includes/class-wp-user.php @@ -324,6 +324,26 @@ class WP_User { $this->data->$key = $value; } + /** + * Magic method for unsetting a certain custom field + * + * @since 4.4.0 + */ + function __unset( $key ) { + if ( 'id' == $key ) { + _deprecated_argument( 'WP_User->id', '2.1', __( 'Use WP_User->ID instead.' ) ); + $key = 'ID'; + } + + if ( isset( $this->data->$key ) ) { + unset( $this->data->$key ); + } + + if ( isset( self::$back_compat_keys[ $key ] ) ) { + unset( self::$back_compat_keys[ $key ] ); + } + } + /** * Determine whether the user exists in the database. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 07ee898183..2a070b31f2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34379'; +$wp_version = '4.4-alpha-34380'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.