[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
Thu Oct 8 21:16:50 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:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------------

Comment (by boonebgorges):

 > But I am laic (just the author of this ticket), so excuse me if this my
 comment is completely unrelevant

 It's an interesting thought, but outside the scope of this ticket :)

 > What's it with these sanity checks though?

 I was hoping we could get through this ticket without addressing the issue
 :-/ The check dates to [28087] #21119. When `prepare_query()` was made
 into a public method, it was found that it wasn't completely idempotent:
 calling `$q->prepare_query()` on an already-prepared query could cause
 additional processing. The only problem that was noted in #21119 was the
 cap-check meta_query, so [28087] was kind of a slap-dash way of taking
 care of it. At some point, the bug was organically refactored out of
 `WP_User_Query`, so the `in_array()` check stopped doing anything. I knew
 this backstory when going into the current ticket, but decided to ignore
 it and leave the check rather than unravel the history of WordPress in
 order to verify that it could be removed :) But I have now done the
 unraveling, and I've determined that the check is no longer necessary, and
 the commit will contain a unit test that demonstrates this fact.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/22212#comment:61>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list