wcpbc_get_installed_currencies

Return installed currencies.

Description

(array) wcpbc_get_installed_currencies(); 

Returns (array)


Usage

  1. if ( !function_exists( 'wcpbc_get_installed_currencies' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-product-price-based-on-countries/includes/wcpbc-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wcpbc_get_installed_currencies(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wcpbc-functions.php  
  1. function wcpbc_get_installed_currencies() { 
  2.  
  3. $base_currency = wcpbc_get_base_currency(); 
  4. $installed_currencies = array(); 
  5.  
  6. foreach (WCPBC()->get_regions() as $region) { 
  7.  
  8. if ( $base_currency !== $region['currency'] && ! in_array( $region['currency'], $installed_currencies ) ) { 
  9. $installed_currencies[] = $region['currency']; 
  10.  
  11. return array_unique( apply_filters( 'wcpbc_installed_currencies', $installed_currencies ) );