Execute `woocommerce_order_action_{$action}` only once
Prevents a “Maximum function nesting level reached” fatal error in certain cases. Since this ends up running on `’save_post’`, updating something like the order status while hooked onto to `woocommerce_order_action_{$action}` causes a fun recursion :)
This commit is contained in:
parent
23b38f9490
commit
f63c5e8c8f
|
@ -128,8 +128,9 @@ class WC_Meta_Box_Order_Actions {
|
|||
|
||||
} else {
|
||||
|
||||
do_action( 'woocommerce_order_action_' . sanitize_title( $action ), $order );
|
||||
|
||||
if ( ! did_action( 'woocommerce_order_action_' . sanitize_title( $action ) ) ) {
|
||||
do_action( 'woocommerce_order_action_' . sanitize_title( $action ), $order );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue