Making WordPress.org


Ignore:
Timestamp:
07/08/2013 05:34:39 PM (12 years ago)
Author:
iandunn
Message:

Adding order parameter to [speaker] shortcode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php

    r53 r54  
    242242            'posts_per_page' => -1,
    243243            'orderby' => 'date',
     244            'order' => 'desc',
    244245        ), $attr );
    245246
    246247        $attr['show_avatars'] = $this->str_to_bool( $attr['show_avatars'] );
    247248        $attr['orderby'] = ( in_array( $attr['orderby'], array( 'date', 'title', 'rand' ) ) ) ? $attr['orderby'] : 'date';
     249        $attr['order'] = ( in_array( $attr['order'], array( 'asc', 'desc') ) ) ? $attr['order'] : 'desc';
    248250
    249251        $speakers = new WP_Query( array(
     
    251253            'posts_per_page' => intval( $attr['posts_per_page'] ),
    252254            'orderby' => $attr['orderby'],
     255            'order' => $attr['order'],
    253256        ) );
    254257
Note: See TracChangeset for help on using the changeset viewer.