Opened 9 months ago
Last modified 9 months ago
#21581 new defect (bug)
Add orderby meta_value to WP_User_Query
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch 2nd-opinion dev-feedback |
| Cc: |
Description
For some reason, we cannot easily order the WP_User_Query() by last_name without directly editing the SQL statements. However, there is an easy way to add this that would work parallel to WP_Query().
// prepare arguments $args = array( 'orderby' => 'meta_value', 'meta_key' => 'last_name', ); $user_query = new WP_User_Query( $args );
Attachments (1)
Note: See
TracTickets for help on using
tickets.

Related: #20606, #20624