-
Notifications
You must be signed in to change notification settings - Fork 0
/
pootlepress-fontawesome-menu-functions.php
38 lines (35 loc) · 1.63 KB
/
pootlepress-fontawesome-menu-functions.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
<?php
$health = 'ok';
if (!function_exists('check_main_heading')) {
function check_main_heading() {
global $health;
if (!function_exists('woo_options_add') ) {
function woo_options_add($options) {
$cx_heading = array( 'name' => __('Canvas Extensions', 'pootlepress-canvas-extensions' ),
'icon' => 'favorite', 'type' => 'heading' );
if (!in_array($cx_heading, $options))
$options[] = $cx_heading;
return $options;
}
} else { // another ( unknown ) child-theme or plugin has defined woo_options_add
$health = 'ng';
}
}
}
add_action( 'admin_init', 'poo_commit_suicide' );
if(!function_exists('poo_commit_suicide')) {
function poo_commit_suicide() {
global $health;
$pluginFile = str_replace('-functions', '', __FILE__);
$plugin = plugin_basename($pluginFile);
$plugin_data = get_plugin_data( $pluginFile, false );
if ( $health == 'ng' && is_plugin_active($plugin) ) {
deactivate_plugins( $plugin );
wp_die( "ERROR: <strong>woo_options_add</strong> function already defined by another plugin. " .
$plugin_data['Name']. " is unable to continue and has been deactivated. " .
"<br /><br />Please contact PootlePress at <a href=\"mailto:[email protected]?subject=Woo_Options_Add Conflict\"> [email protected]</a> for additional information / assistance." .
"<br /><br />Back to the WordPress <a href='".get_admin_url(null, 'plugins.php')."'>Plugins page</a>." );
}
}
}
?>