dashed-slug.net › Forums › Full Node Multi Coin Adapter extension support › How to add multiple Coins › Reply To: How to add multiple Coins
July 31, 2020 at 8:54 am
#8999
alexg
Keymaster
OK.
Suppose you want to add two coins, with symbols ABC and XYZ.
This is how you can use the wallets_multiadapter_coins
filter to add more than one coin (I have omitted most of the settings for clarity):
function wallets_multiadapter_coins_filter( $coins ) {
$coins['ABC'] = array( // replace ABC with the coin's ticker symbol in this line
// Coin symbol (again)
'symbol' => 'ABC',
// Coin name
'name' => 'ABC coin',
// MORE SETTINGS GO 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( // replace XYZ with the coin's ticker symbol in this line
// Coin symbol (again)
'symbol' => 'XYZ',
// Coin name
'name' => 'XYZ coin',
// MORE SETTINGS GO 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' );
If you really wanted to define multiple functions you could, but there’s no need.