WordPress.org

Make WordPress Core

#24687 closed enhancement (duplicate)

WP_Query applies `order` only to last key in `orderby`

Reported by: andy Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5
Component: Query Keywords:
Focuses: Cc:

Description

If you need something like ORDER BY menu_order DESC, ID DESC you are forced to use filters. Instead let's allow orderby to specify either ASC or DESC for each key. Furthermore let's allow orderby to be written naturally with spaces and/or commas (while not strictly checking their correctness as SQL).

Attachments (1)

24687.diff (1.5 KB) - added by andy 10 months ago.

Download all attachments as: .zip

Change History (2)

andy10 months ago

comment:1 SergeyBiryukov10 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version changed from trunk to 3.5

Duplicate of #17065.

Note: See TracTickets for help on using tickets.