mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Accept 'ID' as a valid $field in get_user_by().
We already accept 'id'. `ID` more closely matches the database and `WP_User` schemas. Props Shelob9. Fixes #33869. git-svn-id: https://develop.svn.wordpress.org/trunk@34125 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -445,6 +445,16 @@ class Tests_User extends WP_UnitTestCase {
|
||||
$this->assertEquals( false, $user );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 33869
|
||||
*/
|
||||
public function test_user_get_data_by_ID_should_alias_to_id() {
|
||||
$u = $this->factory->user->create();
|
||||
|
||||
$user = WP_User::get_data_by( 'ID', $u );
|
||||
$this->assertEquals( $u, $user->ID );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 21431
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user