Making WordPress.org

Ticket #547: meta-547.diff

File meta-547.diff, 1.0 KB (added by ryelle, 11 years ago)
  • plugins/wc-post-types/wc-post-types.php

     
    741741                        'track' => 'all',
    742742                        'speaker_link' => 'wporg', // anchor|wporg|none
    743743                        'posts_per_page' => -1,
    744                         'orderby' => 'date',
     744                        'orderby' => 'date', // date|title|rand
     745                        'order' => 'desc', // asc|desc
    745746                ), $attr );
    746747
    747748                // Convert bools to real booleans.
     
    757758
    758759                $attr['orderby'] = ( in_array( $attr['orderby'], array( 'date', 'title', 'rand' ) ) ) ? $attr['orderby'] : 'date';
    759760
     761                if ( $attr['order'] != 'asc' ){
     762                        $attr['order'] = 'desc';
     763                }
     764
    760765                $args = array(
    761766                        'post_type' => 'wcb_session',
    762767                        'posts_per_page' => intval( $attr['posts_per_page'] ),
    763768                        'tax_query' => array(),
    764769                        'orderby' => $attr['orderby'],
     770                        'order' => $attr['order'],
    765771
    766772                        // Only ones marked "session" or where the meta key does
    767773                        // not exist, for backwards compatibility.