Consider ‘auto-draft’ the same as ‘pending’ for orders

This for backwards compat with CPT
This commit is contained in:
Jorge A. Torres 2023-04-10 15:11:03 -05:00
parent 4e16e6117b
commit 18d00cadd0
1 changed files with 1 additions and 1 deletions

View File

@ -638,7 +638,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
// If the old status is set but unknown (e.g. draft) assume its pending for action usage.
if ( $old_status && ! in_array( 'wc-' . $old_status, $this->get_valid_statuses(), true ) && ! in_array( $old_status, $status_exceptions, true ) ) {
if ( $old_status && ( ( ! in_array( 'wc-' . $old_status, $this->get_valid_statuses(), true ) && ! in_array( $old_status, $status_exceptions, true ) ) || 'auto-draft' === $old_status ) ) {
$old_status = 'pending';
}
}