[wp-trac] [WordPress Trac] #53177: WP_User_Query doesn't not accept fields as string except ID

WordPress Trac noreply at wordpress.org
Wed May 12 14:09:17 UTC 2021


#53177: WP_User_Query doesn't not accept fields as string except ID
--------------------------+------------------------------
 Reporter:  rilwis        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Users         |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  docs
--------------------------+------------------------------

Comment (by NomNom99):

 Issue occurs only when **fields** is not an array.
 The bug was on line:
 {{{#!php
 <?php
 $this->query_fields = "$wpdb->users.ID";
 }}}

 where "ID" is hardcoded.
 Added a patch.

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


More information about the wp-trac mailing list