[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 21:01:31 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 ocean90):

 A query which was broken/not limited anymore:

 {{{
 $user_query = new WP_User_Query( array(
     'blog_id' => get_current_blog_id(),
     'fields'  => 'ID',
     'number' => 2
 ) );
 return 1 === (int) $user_query->get_total();
 }}}

 SQL: `SELECT SQL_CALC_FOUND_ROWS wp_users.ID FROM wp_users WHERE 1=1 ORDER
 BY user_login ASC LIMIT 0, 2`

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


More information about the wp-trac mailing list