Cleanup
This commit is contained in:
parent
a443419006
commit
f1a699c259
|
@ -233,10 +233,11 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
|
|||
$query[] = $wpdb->prepare( "AND product_id = %d", $args['product_id'] );
|
||||
}
|
||||
|
||||
$order = in_array( $args['order'], array( 'permission_id', 'download_id', 'product_id', 'order_id', 'order_key', 'user_email', 'user_id', 'downloads_remaining', 'access_granted', 'access_expires', 'download_count' ) ) ? $args['order'] : 'permission_id';
|
||||
$orderby = 'DESC' === strtoupper( $args['orderby'] ) ? 'DESC' : 'ASC';
|
||||
$orderby_sql = sanitize_sql_orderby( "{$orderby} {$order}" );
|
||||
$query[] = "ORDER BY {$orderby_sql}";
|
||||
$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}" );
|
||||
$query[] = "ORDER BY {$orderby_sql}";
|
||||
|
||||
if ( 0 < $args['limit'] ) {
|
||||
$query[] = $wpdb->prepare( "LIMIT %d", $args['limit'] );
|
||||
|
|
Loading…
Reference in New Issue