#21581 closed enhancement (fixed)
Add orderby meta_value to WP_User_Query
| Reported by: | wpsmith | Owned by: | wonderboymusic |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Users | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #20606, #20624