From d92723a33fe492e9af62649030d802e97b8821a7 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 24 Sep 2015 00:48:23 +0000 Subject: [PATCH] Users: in `WP_User::__unset()`, don't reset the deprecated prop `id` to `ID`. Still throw the deprecated notice. Update unit test. Fixes #20043. git-svn-id: https://develop.svn.wordpress.org/trunk@34466 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-user.php | 1 - tests/phpunit/tests/user.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-user.php b/src/wp-includes/class-wp-user.php index 9fb9f262a1..7badeb7575 100644 --- a/src/wp-includes/class-wp-user.php +++ b/src/wp-includes/class-wp-user.php @@ -345,7 +345,6 @@ class WP_User { public 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 ) ) { diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php index ff61749259..56db120884 100644 --- a/tests/phpunit/tests/user.php +++ b/tests/phpunit/tests/user.php @@ -199,7 +199,7 @@ class Tests_User extends WP_UnitTestCase { // Test 'ID' $this->assertNotEmpty( $user->ID ); unset( $user->ID ); - $this->assertEmpty( $user->ID ); + $this->assertNotEmpty( $user->ID ); } // Test meta property magic functions for property get/set/isset.