[wp-trac] [WordPress Trac] #19833: can not sort by 2 custom fields
WordPress Trac
wp-trac at lists.automattic.com
Sat Jan 14 17:23:46 UTC 2012
#19833: can not sort by 2 custom fields
--------------------------+------------------------------
Reporter: zied86 | Owner: zied86@…
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 3.3.1
Severity: blocker | Keywords:
--------------------------+------------------------------
Hello
I followed the syntax of the codex to sort by two criteria of custom
fields, but unfortunately it does not work[[BR]]
http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters[[BR]]
It accepts only one custom field[[BR]]
$args = array(
'post_type' => 'post_type',
'posts_per_page' => '20',
'orderby' => 'custom_field1 custom_field2',
'order' => 'ASC');
[[BR]]
$query = new WP_Query( $args );
[[BR]]
thank you
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19833>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list