[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
Tue Oct 6 20:20:51 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: highest omg bbq | Milestone: 4.4
Component: Users | Version:
Severity: blocker | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+---------------------------
Changes (by Otto42):
* priority: normal => highest omg bbq
* status: closed => reopened
* resolution: fixed =>
* severity: normal => blocker
Comment:
[34875] just took WordPress.org down because of the breaking change to how
the meta query is built on multisite.
The previous version of this function added the query piece for the meta
key = blog_id.capabilities, regardless of whether or not a role was
requested. This limits the users returned to those with some defined role
on this particular multisite instance.
Here in the old version: https://core.trac.wordpress.org/browser/trunk/src
/wp-includes/class-wp-user-query.php?rev=34804#L269
The new version only sets the meta query if one is actually asked for. It
never sets a query for the key by itself, only for key and value.
New version, here: https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/class-wp-user-query.php?rev=34875#L290
This breaks sites with extremely large numbers of users, like
WordPress.org and the 8 million+ users we have.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22212#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list