From 4f5356160b9bbd2411062c1063cab50cfdc9cbfd Mon Sep 17 00:00:00 2001 From: claudiulodro Date: Mon, 25 Sep 2017 14:37:13 -0700 Subject: [PATCH] Dont load gateways unless we really need them --- includes/class-wc-ajax.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index e829f9a1f17..646a06c8e83 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -459,10 +459,10 @@ class WC_AJAX { $status = sanitize_text_field( $_GET['status'] ); $order = wc_get_order( absint( $_GET['order_id'] ) ); - // Initialize payment gateways in case order has hooked status transition actions. - wc()->payment_gateways(); - if ( wc_is_order_status( 'wc-' . $status ) && $order ) { + // Initialize payment gateways in case order has hooked status transition actions. + wc()->payment_gateways(); + $order->update_status( $status, '', true ); do_action( 'woocommerce_order_edit_status', $order->get_id(), $status ); }