-
Notifications
You must be signed in to change notification settings - Fork 0
/
acf-icomoon.php
71 lines (58 loc) · 1.78 KB
/
acf-icomoon.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
69
70
71
<?php
/**
* Plugin Name: Support For Icomoon with Advanced Custom Fields
* Plugin URI: https://wordpress.org/plugins/acf-icomoon/
* Description: 🔩 Add a field to select icons from a selection.json file generated by IcoMoon
* Version: 4.0.10
* Requires at least: 6.6.2
* Requires PHP: 7.2
* Author: ViiVue
* Author URI: https://www.viivue.com/
* Text Domain: acf-icomoon
*/
// If this file is called directly, abort.
if(!defined('WPINC')){
die;
}
// Exit if accessed directly
if(!defined('ABSPATH')){
exit;
}
/**
* Definitions
*/
if(!function_exists('get_plugin_data')){
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
}
$plugin_data = get_plugin_data(__FILE__);
define("ACFICOMOON_VERSION", $plugin_data['Version']);
define("ACFICOMOON_DIR", plugin_dir_path(__FILE__));
define("ACFICOMOON_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/');
define("ACFICOMOON_STYLESHEET_DIR", get_stylesheet_directory());
/**
* Include functions
*/
// helper
include_once(ACFICOMOON_DIR . 'includes/helper.php');
// main functions
include_once(ACFICOMOON_DIR . 'includes/acf-icomoon.php');
/**
* WPBakery Page Builder
*/
add_action('vc_before_init', 'viivue_icomoon_vc_param');
function viivue_icomoon_vc_param(){
include_once(ACFICOMOON_DIR . 'compatibility/js_composer.php');
}
/**
* Admin notices
*/
add_action('admin_notices', 'viivue_icomoon_admin_notices');
function viivue_icomoon_admin_notices(){
if(!function_exists('get_field')){
$notice = sprintf(__(
'Warning: Please activate plugin <a href="%s">Advanced Custom Fields</a> to use plugin Support For Icomoon with Advanced Custom Fields.',
'acf-icomoon'
), admin_url('plugins.php'));
echo '<div class="notice notice-warning"><p>' . $notice . '</p></div>';
}
}