Initialize payment gateways before running bulk actions
This commit is contained in:
parent
ebcdd5fde3
commit
cca7972d8f
|
@ -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.
|
// Sanity check: bail out if this is actually not a status, or is not a registered status.
|
||||||
if ( isset( $order_statuses[ 'wc-' . $new_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 ) {
|
foreach ( $ids as $id ) {
|
||||||
$order = wc_get_order( $id );
|
$order = wc_get_order( $id );
|
||||||
$order->update_status( $new_status, __( 'Order status changed by bulk edit:', 'woocommerce' ), true );
|
$order->update_status( $new_status, __( 'Order status changed by bulk edit:', 'woocommerce' ), true );
|
||||||
|
|
Loading…
Reference in New Issue