Initialize payment gateways before running bulk actions

This commit is contained in:
Mike Jolley 2018-06-12 13:14:09 +01:00
parent ebcdd5fde3
commit cca7972d8f
1 changed files with 3 additions and 0 deletions

View File

@ -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 );