mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Handle case when filter returns null
This commit is contained in:
parent
19b6eebd3e
commit
50e1c743f0
1 changed files with 4 additions and 0 deletions
|
@ -326,7 +326,11 @@ return array(
|
||||||
|
|
||||||
'api.shop.currency' => static function ( ContainerInterface $container ) : string {
|
'api.shop.currency' => static function ( ContainerInterface $container ) : string {
|
||||||
$currency = get_woocommerce_currency();
|
$currency = get_woocommerce_currency();
|
||||||
|
if ( $currency ) {
|
||||||
|
return $currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
$currency = get_option( 'woocommerce_currency' );
|
||||||
if ( ! $currency ) {
|
if ( ! $currency ) {
|
||||||
return 'NO_CURRENCY'; // Unlikely to happen.
|
return 'NO_CURRENCY'; // Unlikely to happen.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue