Skip to content

Commit 19684ce

Browse files
committed
Add second parameter to woocommerce_valid_order_statuses_for_payment filter.
Everywhere the `woocommerce_valid_order_statuses_for_payment` filter is used, a second parameter is passed: the `WC_Order` object. This parameter was missed in woocommerce#25158. Omitting this parameter can cause errors in other extensions expecing that it will be present when hooking into the filter.
1 parent b20ecc6 commit 19684ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/class-wc-order.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ protected function status_transition() {
374374

375375
// Work out if this was for a payment, and trigger a payment_status hook instead.
376376
if (
377-
in_array( $status_transition['from'], apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ) ), true )
377+
in_array( $status_transition['from'], apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $this ), true )
378378
&& in_array( $status_transition['to'], wc_get_is_paid_statuses(), true )
379379
) {
380380
/**

0 commit comments

Comments
 (0)