-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
85 lines (67 loc) · 1.91 KB
/
index.php
File metadata and controls
85 lines (67 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* @pac
* @version 5.4
*/
/*
Plugin Name: Fripixel Crypto Quotation
Plugin URI: http://wordpress.org/plugins/fripixel-crypto-quotation/
Description: Fripixel Crypto Quotation plugin, shows a list of crypto quotation values.
Author: Fripixel
Version: 5.4
Author URI: https://fripixel.com.br
*/
/**
* Register and Enqueue Styles.
*/
require "vendor/autoload.php";
use Fripixel\Libs\CMCQuotation;
function fripixel_crypto_quotation_styles()
{
$theme_version = wp_get_theme()->get("Version");
wp_enqueue_style("fripixel-crypto-quotation-plugin", plugin_dir_url(__FILE__) . "assets/css/app.css", [], $theme_version);
}
/**
* Register and Enqueue Scripts.
*/
function fripixel_crypto_quotation_scripts()
{
$theme_version = wp_get_theme()->get("Version");
wp_enqueue_script("fripixel-crypto-quotation-app", plugin_dir_url(__FILE__) . "assets/js/app.js", [], $theme_version, false);
}
add_action("wp_enqueue_scripts", "fripixel_crypto_quotation_scripts");
add_action("wp_enqueue_scripts", "fripixel_crypto_quotation_styles");
function fripixel_crypto_quotation_show($atts)
{
if(!defined("CMC_API_URL")) {
_e("Please, set the right Fripixel Crypto Quotation configurations!");
exit;
}
if(!defined("CMC_API_KEY")) {
_e("Please, set the right Fripixel Crypto Quotation configurations!");
exit;
}
$atts = shortcode_atts([
"tokens" => "BNB,BTC,ETH,AAVE",
"convert" => "USD",
"locale" => "en-US",
], $atts);
$allowed_html = [
"a" => [
"href" => [],
"title" => [],
],
"br" => [],
"em" => [],
"strong" => [],
];
$symbol = $atts["tokens"];
$convert = $atts["convert"];
$locale = $atts["locale"];
$quotations = (new CMCQuotation($symbol, $convert))->generate();
ob_start();
require "quotation.php";
$content = ob_get_clean();
return $content;
}
add_shortcode("fripixel_crypto_quotation", "fripixel_crypto_quotation_show");