dashed-slug.net › Forums › General discussion › Price of one coin not correct › Reply To: Price of one coin not correct
February 1, 2019 at 10:06 am
#5742
Keymaster
Hello again,
I have a solution:
function wallets_rates_rapidcoin( $rates ) {
$data = json_decode( file_get_contents( 'https://api.coingecko.com/api/v3/simple/price?ids=rapids&vs_currencies=USD,BTC' ) );
if ( $data ) {
$rates['USD_RPD'] = $data->rapids->usd;
$rates['BTC_RPD'] = $data->rapids->btc;
}
return $rates;
}
add_filter( 'wallets_rates', 'wallets_rates_rapidcoin', 100 );
You can insert this into your theme or as a separate one-file plugin.
Or, if you are using a file similar to this one, you can add the code at the bottom of the file.
with regards