Specify default sort order for webhok DS.
This commit is contained in:
parent
93fe370966
commit
02f7a86db0
|
@ -272,7 +272,8 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface {
|
|||
'post_modified' => 'date_modified_gmt',
|
||||
);
|
||||
$orderby = isset( $orderby_mapping[ $args['orderby'] ] ) ? $orderby_mapping[ $args['orderby'] ] : 'webhook_id';
|
||||
$order = "ORDER BY {$orderby} " . esc_sql( strtoupper( $args['order'] ) );
|
||||
$sort = 'ASC' === strtoupper( $args['order'] ) ? 'ASC' : 'DESC';
|
||||
$order = "ORDER BY {$orderby} {$sort}";
|
||||
$limit = -1 < $args['limit'] ? $wpdb->prepare( 'LIMIT %d', $args['limit'] ) : '';
|
||||
$offset = 0 < $args['offset'] ? $wpdb->prepare( 'OFFSET %d', $args['offset'] ) : '';
|
||||
$status = ! empty( $args['status'] ) ? $wpdb->prepare( 'AND `status` = %s', isset( $statuses[ $args['status'] ] ) ? $statuses[ $args['status'] ] : $args['status'] ) : '';
|
||||
|
|
Loading…
Reference in New Issue