diff --git a/includes/data-stores/class-wc-customer-download-data-store.php b/includes/data-stores/class-wc-customer-download-data-store.php index a02bd0bf1b339..591c6e78777f2 100644 --- a/includes/data-stores/class-wc-customer-download-data-store.php +++ b/includes/data-stores/class-wc-customer-download-data-store.php @@ -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'] ) {