Merge pull request #24173 from woocommerce/fix/order-create-track

[Beta fix] Return early if post status is `auto-draft` to prevent fatal.
This commit is contained in:
Gerhard Potgieter 2019-07-22 14:36:44 +02:00 committed by GitHub
commit 1a3e9a668f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -73,6 +73,10 @@ class WC_Orders_Tracking {
return;
}
if ( 'auto-draft' === get_post_status( $id ) ) {
return;
}
$order = wc_get_order( $id );
$date_created = $order->get_date_created()->date( 'Y-m-d H:i:s' );
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification