Add orderby meta_value to WP_User_Query
|Reported by:||wpsmith||Owned by:||wonderboymusic|
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 );
Change History (10)
comment:3 wonderboymusic — 8 months ago
- Keywords 2nd-opinion dev-feedback removed
- Milestone changed from Awaiting Review to 3.7
comment:8 wonderboymusic — 7 months ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
Note: See TracTickets for help on using tickets.