dashed-slug.net › Forums › Full Node Multi Coin Adapter extension support › How to debug this ?
Tagged: coin adapter, filter, wallets_multiadapter_coins
- This topic has 7 replies, 2 voices, and was last updated 6 years, 6 months ago by alexg.
-
AuthorPosts
-
June 1, 2018 at 9:40 am #3183AnonymousInactive
I have installed the plugin, added WP filter with my coin, but I dont see it in menu. How should I turn it on ?
June 1, 2018 at 9:42 am #3184alexgKeymasterHave you installed both the parent plugin and the multiadapter extension?
June 2, 2018 at 8:59 am #3188AnonymousInactiveYes I installed & enabled both. I see all coin adapters except mine
June 4, 2018 at 7:36 am #3190alexgKeymasterOK, here’s how to debug this:
1. Enable WordPress debugging and add something like
error_log( __FUNCTION__ );
in the function where you add your data to the filter. It could be that for some reason you have not hooked the code correctly and it is not running.2. When you say that you do not see it in the menu, are you referring to the frontend menu? The frontend menu only lists adapters that are connected. If you have set up the adapter description correctly but have not set the connection settings then it would appear in your admin screens under Wallets -> Adapters and there would be an error message next to the adapter. This will guide you as to why the adapter is not connecting.
Do let me know what you find and if you get stuck.
kind regards
June 7, 2018 at 12:38 pm #3218AnonymousInactiveIt is definitely a problem with function call.
June 8, 2018 at 6:40 am #3221alexgKeymasterHello,
Could you please be more clear? Is the function not being called?
How are you attaching it to the hook? Where is your code located? Does it run?
June 9, 2018 at 12:18 pm #3235AnonymousInactiveThe functions seems to not being called. The code is located in the themes functions.php (as shown in the manual):
<?php
add_action( ‘wp_enqueue_scripts’, ‘wallettheme_enqueue_styles’ );
function wallettheme_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
}function wallets_multiadapter_coins_filter( $coins ) {
$coins[‘RURT’] = array(
// Coin symbol
‘symbol’ => ‘RURT’,// Coin name
‘name’ => ‘RURtoken’,// Default withdrawal fee (coin adapter settings override this)
‘wd fee’ => ‘0’,// Default internal transaction fee (coin adapter settings override this)
‘move fee’ => ‘0’,// Default min confirmation count required for deposits (coin adapter settings override this)
‘confirms’ => ‘4’,// Default RPC port (coin adapter settings override this)
‘port number’ => ‘443’,// Whether the wallet supports -walletnotify
‘tx notify’ => ‘0’,// Whether the wallet supports -blocknotify
‘block notify’ => ‘0’,// Whether the wallet supports -alertnotify (some wallets have deprecated this)
‘alert notify’ => ‘0’,// Comma separated list of hex bytes, needed for frontend validation of withdraw addresses. Leave blank for no validation.
‘versions’ => ”,// An sprintf() pattern for deposit address QR Code URI. If unsure, set to ‘%s’.
‘qr pattern’ => ‘%s’,// An sprintf() pattern for displaying amounts. If unsure, leave to ‘%01.8f’.
‘amount pattern’ => ‘%01.8f’,// Default sprintf() pattern for URI to block explorer transaction page. Can be overriden with WordPress filter.
‘explorer tx uri’ => ‘https://live.blockcypher.com/ltc/tx/%s/’,// Default sprintf() pattern for URI to block explorer address page. Can be overriden with WordPress filter.
‘explorer address uri’ => ‘https://live.blockcypher.com/ltc/address/%s/’,// URL to an 64×64 icon for the coin. Or leave empty to pull the icon from ‘assets/sprites/SYMBOL.png’.
‘icon url’ => ”,
);
return $coins;
}add_filter( ‘wallets_multiadapter_coins’, ‘wallets_multiadapter_coins_filter’ );
?>
June 11, 2018 at 8:30 am #3239alexgKeymasterHi,
My apologies. This is my fault.
You cannot hook to the
wallets_multiadapter_coins
filter from a theme because it runs before any themes are loaded.You have two options:
- Enter your data into
assets/coins.csv
. This is not ideal because if there is an update to the multiadapter your csv file will be overwritten. But this can be a way to quickly move forward for now. - The best course of action would be to take the code you have and wrap it into a plugin. This is very simple:
- Create a new PHP file
- Add some headers as shown here
- Paste your code beneath the headers
- Copy the PHP file into your
wp-content/plugins
directory - Go to Plugins and activate your plugin.
Thank you for reporting this problem. I will update the online instructions today.
kind regards
Alex
- Enter your data into
-
AuthorPosts
- You must be logged in to reply to this topic.