Do not fire ‘woocommerce_new_order’ when creating auto-draft orders

This commit is contained in:
Jorge Torres 2023-08-11 14:56:38 -03:00
parent 05dfaacd37
commit 4b0416d251
1 changed files with 5 additions and 0 deletions

View File

@ -2276,6 +2276,11 @@ FROM $order_meta_table
$this->persist_save( $order );
// Do not fire 'woocommerce_new_order' for draft statuses for backwards compatibility.
if ( 'auto-draft' === $order->get_status( 'edit') ) {
return;
}
/**
* Fires when a new order is created.
*