updated plugin Easy Digital Downloads version 3.1.1.4.2

This commit is contained in:
2023-06-05 11:21:17 +00:00
committed by Gitium
parent e5482aabb7
commit b7bbe6d733
105 changed files with 3161 additions and 1326 deletions

View File

@ -373,6 +373,25 @@ class Order extends Query {
return $clauses;
}
/**
* When searching by a numeric order number, we need to override the default where clause
* to return orders matching either the ID or order number.
*
* @since 3.1.1.4
* @param array $clauses
* @return array
*/
public function query_by_order_search( $clauses ) {
global $wpdb;
$clauses['where'] = $wpdb->prepare(
"{$this->table_alias}.id = %d OR {$this->table_alias}.order_number = %d",
absint( $this->query_vars['id'] ),
absint( $this->query_vars['order_number'] )
);
return $clauses;
}
/**
* Set the query var defaults for country and region.
*
@ -441,6 +460,10 @@ class Order extends Query {
'condition' => ! empty( $query['discount_id'] ),
'callback' => 'query_by_discount_id',
),
array(
'condition' => ! empty( $query['id'] ) && ! empty( $query['order_number'] ) && $query['id'] === $query['order_number'],
'callback' => 'query_by_order_search',
),
);
}
}