Add function wc_get_is_pending_statuses

This commit is contained in:
plexus admin 2019-01-10 04:43:14 -06:00
parent 5117a65638
commit 9acc7ced5d
2 changed files with 11 additions and 1 deletions

View File

@ -116,7 +116,7 @@ class WC_Shortcode_Checkout {
}
// Ensure order items are still stocked if paying for a failed order. Pending orders do not need this check because stock is held.
if ( ! $order->has_status( 'pending' ) ) {
if ( ! $order->has_status( wc_get_is_pending_statuses() ) ) {
$quantities = array();
foreach ( $order->get_items() as $item_key => $item ) {

View File

@ -124,6 +124,16 @@ function wc_get_is_paid_statuses() {
return apply_filters( 'woocommerce_order_is_paid_statuses', array( 'processing', 'completed' ) );
}
/**
* Get list of statuses which are consider 'pending payment'.
*
* @since 3.5.4
* @return array
*/
function wc_get_is_pending_statuses() {
return apply_filters( 'woocommerce_order_is_pending_statuses', array( 'pending' ) );
}
/**
* Get the nice name for an order status.
*