Skip to content

Commit

Permalink
Flip orderby
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Apr 3, 2017
1 parent e2936b0 commit 0a96f17
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function get_downloads( $args = array() ) {
$allowed_orders = array( 'permission_id', 'download_id', 'product_id', 'order_id', 'order_key', 'user_email', 'user_id', 'downloads_remaining', 'access_granted', 'access_expires', 'download_count' );
$order = in_array( $args['order'], $allowed_orders ) ? $args['order'] : 'permission_id';
$orderby = 'DESC' === strtoupper( $args['orderby'] ) ? 'DESC' : 'ASC';
$orderby_sql = sanitize_sql_orderby( "{$orderby} {$order}" );
$orderby_sql = sanitize_sql_orderby( "{$order} {$orderby}" );
$query[] = "ORDER BY {$orderby_sql}";

if ( 0 < $args['limit'] ) {
Expand Down

0 comments on commit 0a96f17

Please sign in to comment.