[wp-trac] [WordPress Trac] #22212: WP_User_Query( array('role' => $role) ) should accept array or not return anything if array
WordPress Trac
noreply at wordpress.org
Mon Oct 12 21:28:35 UTC 2015
#22212: WP_User_Query( array('role' => $role) ) should accept array or not return
anything if array
--------------------------------------+---------------------------
Reporter: thomask | Owner: boonebgorges
Type: enhancement | Status: reopened
Priority: normal | Milestone: 4.4
Component: Users | Version:
Severity: major | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+---------------------------
Changes (by ocean90):
* status: closed => reopened
* resolution: fixed =>
* severity: normal => major
Comment:
[34959] introduced a bug with similiar role names, like "editor" and "foo-
editor". That's because the quotes for the role value are missing.
Query before [34959]:
{{{
SELECT wptests_users.* FROM wptests_users INNER JOIN wptests_usermeta ON (
wptests_users.ID = wptests_usermeta.user_id ) WHERE 1=1 AND (
( wptests_usermeta.meta_key = 'wptests_capabilities' AND
CAST(wptests_usermeta.meta_value AS CHAR) LIKE '%\"editor\"%' )
) ORDER BY user_login ASC
}}}
Query after [34959]:
{{{
SELECT wptests_users.* FROM wptests_users INNER JOIN wptests_usermeta ON (
wptests_users.ID = wptests_usermeta.user_id ) WHERE 1=1 AND (
(
( wptests_usermeta.meta_key = 'wptests_capabilities' AND
CAST(wptests_usermeta.meta_value AS CHAR) LIKE '%editor%' )
)
) ORDER BY user_login ASC
}}}
[attachment:22212.3.diff] includes a test and the fix.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22212#comment:63>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list