#21581 closed enhancement (fixed)
Add orderby meta_value to WP_User_Query
Reported by: | wpsmith | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch |
Focuses: | 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)
Change History (11)
#3
@
11 years ago
- Keywords 2nd-opinion dev-feedback removed
- Milestone changed from Awaiting Review to 3.7
Makes sense, patch still applies
#5
@
11 years ago
Duplicate: #17179 See patch: http://core.trac.wordpress.org/attachment/ticket/17179/17179.patch
Note: See
TracTickets for help on using
tickets.
Related: #20606, #20624