Set created_via propery for orders created in admin area

This commit is contained in:
Daniel Bitzer 2018-04-05 13:58:51 +02:00
parent 3c35320f76
commit 1f5d4050b3
1 changed files with 5 additions and 0 deletions

View File

@ -600,6 +600,11 @@ class WC_Meta_Box_Order_Data {
$props['date_created'] = $date;
// Set created via prop if new post.
if ( isset( $_POST['original_post_status'] ) && $_POST['original_post_status'] === 'auto-draft' ) {
$props['created_via'] = 'admin';
}
// Save order data.
$order->set_props( $props );
$order->set_status( wc_clean( $_POST['order_status'] ), '', true );