WPCS - WordPress Currency Switcher

wpcs_currency_manipulation_before_show

Allows to manipulate with currencies before showing their drop-downs on the front, example:

add_filter('wpcs_currency_manipulation_before_show', function($currencies) {
    $any_conditions = true;

    if ($any_conditions) {
        unset($currencies['RUB']);
        unset($currencies['GBP']);
    }

    return $currencies;
});

Structure of the data in variable $currencies in the example above is:

Array
(
    [USD] => Array
        (
            [name] => USD
            [rate] => 1
            [symbol] => $
            [position] => left
            [is_etalon] => 1
            [hide_cents] => 0
            [description] => United States dollar
            [flag] => ''
        )
    [GBP] => Array
        (
            [name] => GBP
            [rate] => 0.80
            [symbol] => £
            [position] => left
            [is_etalon] => 0
            [hide_cents] => 0
            [description] => British pound
            [flag] => ''
        )

    [UAH] => Array
        (
            [name] => UAH
            [rate] => 26.069684
            [symbol] => грн.
            [position] => left
            [is_etalon] => 0
            [hide_cents] => 0
            [description] => Украинская гривна
            [flag] => ''
        )

    [RUB] => Array
        (
            [name] => RUB
            [rate] => 62.218399
            [symbol] => руб.
            [position] => left
            [is_etalon] => 0
            [hide_cents] => 0
            [description] => Российский рубль
            [flag] => ''
        )

)

 

from ver.2.1.2/1.1.2