I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).
If you are new here, please see some information on how to ask for support. Thank you!
-
Hello,
Yes, this makes sense. You have declared two functions with the same name. When adding the second adapter, either rename your second wallets_multiadapter_coins_filter
function to something else, or simply add both coins using the same function.
with regards
I see. Could you please provide an example on how I could add both coins using the same function? do I just simply copy & paste the code below the first adapter?
Sure, here’s an example. I have omitted most of the rows for clarity, hopefully you get the idea:
function wallets_multiadapter_coins_filter( $coins ) {
$coins['ABC'] = array(
// Coin symbol
'symbol' => 'ABC',
// Coin name
'name' => 'ABC coin',
// several rows omitted here
// URL to an 64x64 icon for the coin. Or leave empty to pull the icon from 'assets/sprites/SYMBOL.png'.
'icon url' => 'http://www.example.com/abc-coin-icon-64x64.png',
);
$coins['XYZ'] = array(
// Coin symbol
'symbol' => 'XYZ',
// Coin name
'name' => 'XYZ coin',
// several rows omitted here
// URL to an 64x64 icon for the coin. Or leave empty to pull the icon from 'assets/sprites/SYMBOL.png'.
'icon url' => 'http://www.example.com/xyz-coin-icon-64x64.png',
);
return $coins;
}
add_filter( 'wallets_multiadapter_coins', 'wallets_multiadapter_coins_filter' );
I am sorry… I still don’t get it :-/
Hello,
In the example above, the only thing that’s missing is the plugin headers (you can use the ones from https://gist.github.com/alex-georgiou/11e19523697d4c1a84c83874690466c3) and some rows that you need to add with the data for each of your two coins. Other than that, there is nothing else missing.
What is your question?
- You must be logged in to reply to this topic.