-
Notifications
You must be signed in to change notification settings - Fork 2
/
plugin.php
executable file
·48 lines (42 loc) · 1.36 KB
/
plugin.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
<?php
/**
* Plugin Name: DustPress.JS
* Plugin URI: https://github.com/devgeniem/dustpress-js
* Description: DustPress JavaScript library. Provides a front-end interface for interacting with the backend functions.
* Version: 4.4.2
* Author: Geniem Oy / Miika Arponen, Ville Siltala & Arttu Mäkipörhölä
* Author URI: http://www.geniem.com
*/
class DustPressJs {
/**
* Initalizes the plugin
*
* @type function
* @date 24/05/2016
* @since 0.1.0
*
* @return void
*/
public function __construct() {
add_action( 'init', [ $this, 'enqueue_scripts' ] );
}
/**
* This function enqueues front end scripts.
*
* @type function
* @date 17/12/2015
* @since 0.1.0
*
* @return void
*/
public function enqueue_scripts() {
// Variables.
$plugin_data = get_file_data( __FILE__, [ 'Version' => 'Version' ], 'plugin' );
$version = $plugin_data['Version'];
$dependencies = apply_filters( 'dustpress/js/dependencies', [ 'jquery' ] );
$in_footer = apply_filters( 'dustpress/js/in_footer', false );
wp_register_script( 'dustpress', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/dustpress-min.js', $dependencies, $version, $in_footer );
wp_enqueue_script( 'dustpress' );
}
}
new DustPressJs();