dashed-slug.net › Forums › Exchange extension support › latest price info? › Reply To: latest price info?
October 8, 2018 at 4:59 am
#4731
megeanwasson
Participant
Work In Progress, just taken your idea and suggestion by Alex and wrapped into a plugin.
Save into file called showcoinlastprice.php put into a folder called showcoinlastprice and zip it, then install just like you do any other plugin.
Use shortcode where ever you want last price for your coin to be shown.
<?php
/*
Plugin Name: Show Coin Last Price
Plugin URI: https://www.africawebsolutions.org
Description: Show Primary Coin Last Price
Version: Ver 0.001
Author: Megan Wasson
Author URI: https://www.africawebsolutions.org
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: showcoinlastprice
showcoinlastprice is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
any later version.
showcoinlastprice is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with showcoinlastprice. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
*/
// Use ShortCode [showCOINBTCPrice] where ever you want your coins last price to show.
function showCOINBTCPrice_shortcode($atts = [], $coinlastprice = null)
{
$market_summary = apply_filters(
'wallets_api_market_summary',
null,
array(
'base_symbol' => 'BTC', // < ----- change to your Base Coin Symbol info here
'quote_symbol' => 'COIN', // < ----- change to your Coin Symbol info here
)
);
$coinlastprice = $market_summary->last_price;
// always return
return $coinlastprice;
}
add_shortcode('showCOINBTCPrice', 'showCOINBTCPrice_shortcode');