From 164b39ea428b1d72f1db81aa3e3720d736304f90 Mon Sep 17 00:00:00 2001 From: Kevin Hagerty Date: Sat, 5 Sep 2015 08:09:47 -0400 Subject: [PATCH] Use the needs_payment function Instead of checking against a list of valid order statuses, use the needs_payment function which already checks against those statuses --- includes/class-wc-form-handler.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index 3cd1c33a260..68a1620e694 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -266,9 +266,7 @@ class WC_Form_Handler { $order_id = absint( $wp->query_vars['order-pay'] ); $order = wc_get_order( $order_id ); - $valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ); - - if ( $order->id == $order_id && $order->order_key == $order_key && $order->has_status( $valid_order_statuses ) ) { + if ( $order->id == $order_id && $order->order_key == $order_key && $order->needs_payment() ) { // Set customer location to order location if ( $order->billing_country ) {