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!

ERROR when activating second coin adapter

dashed-slug.net Forums Full Node Multi Coin Adapter extension support ERROR when activating second coin adapter

Tagged: , , ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5432
    alexg
    Keymaster

    It was running fine when I was only having 1 adapter but when I created the second adapter (php file) and tried activating it, it gave me the following error:

    Fatal error: Cannot redeclare wallets_multiadapter_coins_filter() (previously declared in /var/www/html/wp-content/plugins/coin1.php:12) in /var/www/html/wp-content/plugins/coin2.php on line 12

    #5433
    alexg
    Keymaster

    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

    #5441
    alexg
    Keymaster

    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?

    #5453
    alexg
    Keymaster

    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' );
    #5566
    alexg
    Keymaster

    I am sorry… I still don’t get it :-/

    #5570
    alexg
    Keymaster

    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?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.