From cca7972d8fb61469ded1d1ceb94512bd38f0cc7b Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 12 Jun 2018 13:14:09 +0100 Subject: [PATCH] Initialize payment gateways before running bulk actions --- .../admin/list-tables/class-wc-admin-list-table-orders.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/admin/list-tables/class-wc-admin-list-table-orders.php b/includes/admin/list-tables/class-wc-admin-list-table-orders.php index 612aac9dfd7..2d3d98c7c61 100644 --- a/includes/admin/list-tables/class-wc-admin-list-table-orders.php +++ b/includes/admin/list-tables/class-wc-admin-list-table-orders.php @@ -644,6 +644,9 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { // Sanity check: bail out if this is actually not a status, or is not a registered status. if ( isset( $order_statuses[ 'wc-' . $new_status ] ) ) { + // Initialize payment gateways in case order has hooked status transition actions. + wc()->payment_gateways(); + foreach ( $ids as $id ) { $order = wc_get_order( $id ); $order->update_status( $new_status, __( 'Order status changed by bulk edit:', 'woocommerce' ), true );