-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdonation-goal-thermometer.php
59 lines (50 loc) · 1.3 KB
/
donation-goal-thermometer.php
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
<?php
/*
Plugin Name: Donation Goal Thermometer
Plugin URI:
Description: Display a thermometer chart for donation goals, with an easy to use shortcode.
Version: 0.0.2
Author: brandiD
Author URI: https://thebrandiD.com
Text Domain: donationgoalthermometer
*/
if ( ! defined( 'ABSPATH' ) ) {
die( "Denied." );
}
// Define Constants.
define( 'DGTHERMOMETER_PLUGIN_VERSION', '0.0.2');
// Load plugin functions.
require_once plugin_dir_path( __FILE__ ) . 'donationgoalthermometer-functions.php';
// Add action to enqueue required files.
add_action( 'wp_enqueue_scripts', 'donation_goal_thermometer_load_scripts' );
/**
* Loads required scripts and styles.
*
* @since 0.0.1
*
*/
function donation_goal_thermometer_load_scripts() {
// Enqueue jQuery.thermometer.
wp_enqueue_script(
'jquery-thermometer',
plugin_dir_url( __FILE__ ) . 'js/jquery.thermometer.js',
[ 'jquery' ],
'1.0',
true
);
// Enqueue custom thermometer JS.
wp_enqueue_script(
'donation-goal-thermometer-js',
plugin_dir_url( __FILE__ ) . 'js/donation-goal-thermometer.js',
[ 'jquery', 'jquery-thermometer' ],
DGTHERMOMETER_PLUGIN_VERSION,
true
);
wp_enqueue_style(
'donationgoalthermometer-css',
plugin_dir_url( __FILE__ ) . 'css/donationgoalthermometer-style.css',
array(),
DGTHERMOMETER_PLUGIN_VERSION,
'all'
);
}