updated plugin Easy Digital Downloads version 3.1.1.2

This commit is contained in:
2023-03-17 22:34:04 +00:00
committed by Gitium
parent e8a66564bd
commit 19e086d1c4
647 changed files with 20986 additions and 27305 deletions

View File

@ -64,6 +64,27 @@ function edd_add_order_address( $data ) {
return false;
}
// If this exact address exists already, we can return false.
if ( edd_get_order_addresses( $data ) ) {
return false;
}
// If the new address is a billing address and there is one already, update it instead of adding a new one.
if ( empty( $data['type'] ) || 'billing' === $data['type'] ) {
$order_addresses = edd_get_order_addresses(
array(
'type' => 'billing',
'order_id' => $data['order_id'],
)
);
if ( ! empty( $order_addresses ) ) {
$order_address = reset( $order_addresses );
edd_update_order_address( $order_address->id, $data );
return false;
}
}
// Instantiate a query object
$order_addresses = new EDD\Database\Queries\Order_Address();