Currency::is_current_currency_supported()
Verify if currency is supported.
Return
(bool)
Source
File: src/Tickets/Commerce/Utils/Currency.php
public static function is_current_currency_supported(): bool {
// Get currency code option.
$currency = tribe_get_option( static::$currency_code_option );
// Get unsupported currencies.
$unsupported_currencies = static::get_unsupported_currencies();
if ( array_key_exists( $currency, $unsupported_currencies ) ) {
// Get the unsupported currency.
static::$unsupported_currency = $unsupported_currencies[ $currency ];
// Get the currency symbol.
$default_map = static::get_default_currency_map();
static::$unsupported_currency['symbol'] = $default_map[ $currency ]['symbol'];
// Update currency option to the new value.
static::update_currency_option( $unsupported_currencies[ $currency ]['new_value'] );
return false;
}
return true;
}
Changelog
| Version | Description |
|---|---|
| 5.5.7 | Introduced. |