Handle default status

This commit is contained in:
Mike Jolley 2016-08-08 17:24:39 +01:00
parent 6a493f7350
commit e8d85005d7
1 changed files with 4 additions and 0 deletions

View File

@ -92,6 +92,10 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
} elseif ( ! empty( $order->ID ) ) {
$this->read( absint( $order->ID ) );
}
// Set default status if none were read.
if ( ! $this->get_status() ) {
$this->set_status( apply_filters( 'woocommerce_default_order_status', 'pending' ) );
}
}
/*