WordPress/WordPress — pull request #47 by jameslnewell (2013-09-12 01:25:56+00:00)
Title: Patch to enable developers to use different orderings per field specifie...

I want a query ordered by menu order and date with both columns sorted in DESC order.

My code is:

$query = new WP_Query(array(
'orderby' => 'menu_order date',
'order' => 'DESC',
));

But WP_Query creates this query (which MySQL sorts menu_order ASC because no column ordering was specified):

ORDER BY wp_posts.menu_order,wp_posts.post_date DESC

This PR will create this query:

ORDER BY wp_posts.menu_order DESC,wp_posts.post_date DESC

Or if `'order' => 'DESC ASC'` it will create this query:

ORDER BY wp_posts.menu_order DESC,wp_posts.post_date ASC