[wp-trac] [WordPress Trac] #29666: Mulitiple orderby/order pairs

WordPress Trac noreply at wordpress.org
Sun Sep 14 08:16:43 UTC 2014


#29666: Mulitiple orderby/order pairs
--------------------------+-----------------------------
 Reporter:  lavrenuk      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  4.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In documentation: http://codex.wordpress.org/Class_Reference/WP_Query
 Chapter: Mulitiple orderby/order pairs

 this code does not work,
 sorts only on one field
 {{{
 $the_query = new WP_Query (
     array (
        'posts_per_page' => -1,
        'cat'            => $ccat->cat_ID,
        'orderby'        => array (
          'meta_value_num' => 'DESC',
          'title'          => 'ASC',
        ),
        'meta_key'       => 'count',
    )
 );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29666>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list