Check we have a valid order in wc_get_payment_gateway_by_order
Fixes #14973
This commit is contained in:
parent
75def72ff7
commit
7c82087bcd
|
@ -704,7 +704,7 @@ function wc_get_payment_gateway_by_order( $order ) {
|
||||||
$order = wc_get_order( $order_id );
|
$order = wc_get_order( $order_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
return isset( $payment_gateways[ $order->get_payment_method() ] ) ? $payment_gateways[ $order->get_payment_method() ] : false;
|
return is_a( $order, 'WC_Order' ) && isset( $payment_gateways[ $order->get_payment_method() ] ) ? $payment_gateways[ $order->get_payment_method() ] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue