forked from acf-extended/ACF-Extended
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
85 lines (62 loc) · 1.75 KB
/
init.php
File metadata and controls
85 lines (62 loc) · 1.75 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
if(!defined('ABSPATH'))
exit;
/**
* ACFE: Include
*
* @param string $filename
*/
function acfe_include($filename = ''){
$file_path = ACFE_PATH . ltrim($filename, '/');
if(file_exists($file_path)){
include_once($file_path);
}
}
/**
* ACFE: Get URL
*
* @param string $filename
*
* @return string
*/
function acfe_get_url($filename = ''){
if(!defined('ACFE_URL')){
define('ACFE_URL', acf_get_setting('acfe/url'));
}
return ACFE_URL . ltrim($filename, '/');
}
/**
* ACFE: ACF Pro Check
*
* @param $plugin_file
* @param $plugin_data
* @param $status
*/
add_action('after_plugin_row_' . ACFE_BASENAME, 'acfe_plugin_row', 5, 3);
function acfe_plugin_row($plugin_file, $plugin_data, $status){
if(acfe()->has_acf())
return;
?>
<style>
.plugins tr[data-plugin='<?php echo ACFE_BASENAME; ?>'] th,
.plugins tr[data-plugin='<?php echo ACFE_BASENAME; ?>'] td{
box-shadow:none;
}
<?php if(isset($plugin_data['update']) && !empty($plugin_data['update'])){ ?>
.plugins tr.acfe-plugin-tr td{
box-shadow:none !important;
}
.plugins tr.acfe-plugin-tr .update-message{
margin-bottom:0;
}
<?php } ?>
</style>
<tr class="plugin-update-tr active acfe-plugin-tr">
<td colspan="3" class="plugin-update colspanchange">
<div class="update-message notice inline notice-error notice-alt">
<p><?php _e('ACF Extended requires Advanced Custom Fields PRO (minimum: 5.7.10).', 'acfe'); ?></p>
</div>
</td>
</tr>
<?php
}