mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Fix potential type error on woocommerce_available_payment_gateways hook handler.
This commit is contained in:
parent
4183689a68
commit
f8a872c382
2 changed files with 21 additions and 2 deletions
|
@ -195,8 +195,18 @@ class VaultingModule implements ModuleInterface {
|
|||
|
||||
add_filter(
|
||||
'woocommerce_available_payment_gateways',
|
||||
function( array $methods ): array {
|
||||
/**
|
||||
* Param types removed to avoid third-party issues.
|
||||
*
|
||||
* @psalm-suppress MissingClosureParamType
|
||||
*/
|
||||
function( $methods ) {
|
||||
global $wp;
|
||||
|
||||
if ( ! is_array( $methods ) ) {
|
||||
return $methods;
|
||||
}
|
||||
|
||||
if (
|
||||
isset( $wp->query_vars['add-payment-method'] )
|
||||
&& apply_filters( 'woocommerce_paypal_payments_disable_add_payment_method', true )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue