mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Don't match partial roles in WP_User_Query.
Because 'role=ocean90' shouldn't match 'role=bocean901'. Props bocean901, ocean90. Fixes #22212. git-svn-id: https://develop.svn.wordpress.org/trunk@35101 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -955,6 +955,27 @@ class Tests_User_Query extends WP_UnitTestCase {
|
||||
$this->assertEquals( 2, count( $users ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 22212
|
||||
*/
|
||||
public function test_get_single_role_by_string_which_is_similar() {
|
||||
$editors = $this->factory->user->create_many( 2, array(
|
||||
'role' => 'editor',
|
||||
) );
|
||||
|
||||
$another_editor = $this->factory->user->create( array(
|
||||
'role' => 'another-editor',
|
||||
) );
|
||||
|
||||
$users = get_users( array(
|
||||
'role' => 'editor',
|
||||
'fields' => 'ids',
|
||||
) );
|
||||
|
||||
$this->assertEqualSets( $editors, $users );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ticket 22212
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user