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

WordPress Trac noreply at wordpress.org
Fri May 6 04:40:50 UTC 2022

#53177: WP_User_Query does not accept fields as string except ID
 Reporter:  rilwis                               |       Owner:  audrasjb
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.0
Component:  Users                                |     Version:  4.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-testing-info has-dev-note has-   |     Focuses:  docs
  patch has-unit-tests needs-docs                |

Comment (by peterwilsoncc):

 In the [https://github.com/WordPress/wordpress-develop/pull/2676 linked
 pull request]:

 * both `ID` and `id` are returned when fields is an array containing `ID`
 * The `fields` parameter is case insensitive. This matches the old
 behavior as the prior values were passed to the database which is case
 * split up tests to separate an array of fields from a single field to
 reduce logic within the test
 * added all fields in the table to allowed fields (props @pbearne, I
 cherry picked from Paul's PR)

 Obviously my code is perfect and flawless in every way but @dd32 could you
 please check it fixes your bug, @kraftbj could you please check it doesn't
 reintroduce what you've already fixed?

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

More information about the wp-trac mailing list