-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwp-o2-tribute.php
68 lines (55 loc) · 1.76 KB
/
wp-o2-tribute.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
60
61
62
63
64
65
66
67
68
<?php
/**
* Plugin Name: wp-o2-tribute
* Description: Add <strong>@category</strong> and <strong>#tag</strong> autocomplete links to o2 plugin
* Plugin URI: https://github.com/evgrezanov/wp-o2-tribute
* Author URI: https://www.upwork.com/freelancers/~01ea58721977099d53
* Author: <a href="https://www.upwork.com/freelancers/~01ea58721977099d53" target="_blank">Evgeniy Rezanov</a>
* Version: 1.2.3
* GitHub Plugin URI: evgrezanov/wp-o2-tribute
* GitHub Plugin URI: https://github.com/evgrezanov/wp-o2-tribute
* Text Domain: wp-o2-tribute
* Domain Path: /languages
*/
defined('ABSPATH') || exit;
define('O2_TRIBUTE_VERSION', '1.2.3' );
class WP_O2_TRIBUTE {
public static function init() {
add_action('wp_enqueue_scripts', [__CLASS__, 'assets']);
}
public static function assets(){
wp_enqueue_script(
'tribute',
plugins_url('wp-o2-tribute/asset/tribute/tribute.min.js'),
array('jquery'),
O2_TRIBUTE_VERSION
);
wp_register_script(
'tribute-action',
plugins_url('wp-o2-tribute/asset/script.js')
);
wp_localize_script(
'tribute-action',
'tributeO2Data',
$arg_array = [
'endpoint' => get_rest_url(0, '/wp/v2/')
]
);
wp_enqueue_script(
'tribute-action',
plugins_url('wp-o2-tribute/asset/script.js'),
array(
'tribute',
'o2-app'
),
O2_TRIBUTE_VERSION,
true
);
wp_enqueue_style(
'tribute-styles',
plugins_url('wp-o2-tribute/asset/tribute/tribute.css')
);
}
}
WP_O2_TRIBUTE::init();
?>