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
This commit is contained in:
parent
c1c93f1e95
commit
d92723a33f
@ -345,7 +345,6 @@ class WP_User {
|
||||
public function __unset( $key ) {
|
||||
if ( 'id' == $key ) {
|
||||
_deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) );
|
||||
$key = 'ID';
|
||||
}
|
||||
|
||||
if ( isset( $this->data->$key ) ) {
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user