-
Notifications
You must be signed in to change notification settings - Fork 1
/
pootlepress-align-right-functions.php
executable file
·52 lines (49 loc) · 2.04 KB
/
pootlepress-align-right-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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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>." );
}
}
}
/*
* Fixes compatibility issues with sticky nav plugin on mobile nav
*/
function pp_ar_fixStickyMobile(){
?>
<script type="text/javascript">
jQuery(function ($) {
$(document).ready(function() {
//Remove navigation styles for mobile
$('#navigation').css({position:'','min-height':'',left:'','margin-top':'',width:''});
});
});
</script>
<?php
}