Opened 11 years ago
Closed 11 years ago
#31265 closed task (blessed) (fixed)
Metadata 'orderby' parity across query classes
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 4.2 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Query | Keywords: | needs-patch |
| Focuses: | Cc: |
Description (last modified by )
WP_Query, WP_User_Query, and WP_Comment_Query all have some support for ordering results by metadata (postmeta, usermeta, or commentmeta). But the support is inconsistent. WP_Query should be the reference, and we should sweep through WP_User_Query and WP_Comment_Query to ensure that they're up to snuff. Things to check:
- --'orderby' should accept space-separated values (
'orderby' => 'comment_user_ID comment_ID') as well as the array syntax introduced toWP_Queryin #17065. See #30478.-- [done] meta_value,meta_key,meta_type, andmeta_compareshould all be supported, and should be translated to ameta_queryclause in the same way (usingWP_Meta_Query::parse_query_vars(), I suppose)orderby=meta_value,orderby=meta_value_num, andorderby=somekeywhenmeta_key=somekeyshould be supported. See #27887.orderby=clausename, where 'clausename' is the array-key identifier of ameta_queryclause. See #31045 for how this was done inWP_Query.
Some of this is done, some is definitely not, some I'm too lazy to check at the moment. All of it needs unit tests.
Change History (11)
Note: See
TracTickets for help on using
tickets.
In 31467: