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:
Boone Gorges
2015-09-14 18:57:15 +00:00
parent 9700eb511e
commit 974517d2bc
3 changed files with 19 additions and 2 deletions

View File

@@ -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
*/