WPCS - WordPress Currency Switcher Professional

wpcs_currency_data_manipulation

This hook uses in public function get_currencies of the plugin:

public function get_currencies()
{

    $default = array(
	'USD' => array(
	    'name' => 'USD',
	    'rate' => 1,
	    'symbol' => '$',
	    'position' => 'right',
	    'is_etalon' => 1,
	    'description' => 'USA dollar',
	    'hide_cents' => 0,
	    'flag' => '',
	),
	'EUR' => array(
	    'name' => 'EUR',
	    'rate' => 0.89,
	    'symbol' => '€',
	    'position' => 'left_space',
	    'is_etalon' => 0,
	    'description' => 'Europian Euro',
	    'hide_cents' => 0,
	    'flag' => '',
	)
    );

    $currencies = get_option('wpcs', $default);
    $currencies = apply_filters('wpcs_currency_data_manipulation', $currencies);


    if (empty($currencies) OR ! is_array($currencies))
    {
	   $currencies = $default;
    }


    return $currencies;
}

So you can use it for any manipulations with the currencies data.

Example:

add_filter('wpcs_currency_data_manipulation', 'my_wpcs_currency_data_manipulation', 1, 1);

function my_wpcs_currency_data_manipulation($currencies)
{
    foreach ($currencies as $key => $value)
    {
	  if ($key == 'USD')
          {
	         $currencies[$key]['rate'] = $value['rate'] + 0.10;
	         break;
          }
    }
    return $currencies;
}