Making WordPress.org

Changeset 799


Ignore:
Timestamp:
08/15/2014 10:36:30 PM (11 years ago)
Author:
iandunn
Message:

WordCamp Post Types: Add order attribute to sessions shortcode.

Fixes #547
props ryelle

File:
1 edited

Legend:

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

    r788 r799  
    812812            'speaker_link' => 'wporg', // anchor|wporg|permalink|none
    813813            'posts_per_page' => -1,
    814             'orderby' => 'date',
     814            'orderby' => 'date', // date|title|rand
     815            'order'   => 'desc', // asc|desc
    815816        ), $attr );
    816817
     
    827828
    828829        $attr['orderby'] = ( in_array( $attr['orderby'], array( 'date', 'title', 'rand' ) ) ) ? $attr['orderby'] : 'date';
     830
     831        if ( 'asc' != $attr['order'] ) {
     832            $attr['order'] = 'desc';
     833        }
    829834
    830835        $args = array(
     
    833838            'tax_query' => array(),
    834839            'orderby' => $attr['orderby'],
     840            'order'   => $attr['order'],
    835841
    836842            // Only ones marked "session" or where the meta key does
Note: See TracChangeset for help on using the changeset viewer.