-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpootlepress-menu-pack-functions.php
executable file
·161 lines (137 loc) · 6.83 KB
/
pootlepress-menu-pack-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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?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>." );
}
}
}
function woo_nav_custom() {
global $woo_options;
woo_nav_before();
$_id = get_option('pootlepress-menu-pack-menu-style');
if ($_id =='') $_id = 0;
?>
<div id="nav1">
<div id="navigation" class="col-full">
<?php //woo_nav_inside(); ?>
<a href="<?php echo home_url(); ?>" class="nav-home"><span><?php _e( 'Home', 'woothemes' ); ?></span></a>
<?php
if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
wp_nav_menu( array( 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu' ) );
} else {
?>
<ul id="main-nav" class="nav fl">
<?php
if ( get_option( 'woo_custom_nav_menu' ) == 'true' ) {
if ( function_exists( 'woo_custom_navigation_output' ) ) { woo_custom_navigation_output( 'name=Woo Menu 1' ); }
} else { ?>
<?php if ( is_page() ) { $highlight = 'page_item'; } else { $highlight = 'page_item current_page_item'; } ?>
<li class="<?php echo esc_attr( $highlight ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
<?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
<?php } ?>
</ul><!-- /#nav -->
<?php } ?>
<a href="#top" class="nav-close"><span><?php _e('Return to Content', 'woothemes' ); ?></span></a>
</div><!-- /#navigation -->
</div>
<div id="navigation_<?php echo $_id;?>" class="col-full">
<?php //woo_nav_inside(); ?>
<?php
if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
wp_nav_menu( array( 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu' ) );
} else {
?>
<ul id="main-nav" class="nav fl">
<?php
if ( get_option( 'woo_custom_nav_menu' ) == 'true' ) {
if ( function_exists( 'woo_custom_navigation_output' ) ) { woo_custom_navigation_output( 'name=Woo Menu 1' ); }
} else { ?>
<?php if ( is_page() ) { $highlight = 'page_item'; } else { $highlight = 'page_item current_page_item'; } ?>
<li class="<?php echo esc_attr( $highlight ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
<?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
<?php } ?>
</ul><!-- /#nav -->
<?php } ?>
</div><!-- /#navigation -->
<?php
woo_nav_after();
} // End woo_nav_custom()
function woo_nav_beautiful_type() {
global $woo_options;
woo_nav_before();
$_id = get_option('pootlepress-menu-pack-menu-style');
?>
<div id="navigation_<?php echo $_id;?>" class="col-full">
<?php //woo_nav_inside(); ?>
<a href="<?php echo home_url(); ?>" class="nav-home"><span><?php _e( 'Home', 'woothemes' ); ?></span></a>
<?php
if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
wp_nav_menu( array( 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu', 'link_before'=>'<span>', 'link_after'=>'</span>') );
} else {
?>
<ul id="main-nav" class="nav fl">
<?php
if ( get_option( 'woo_custom_nav_menu' ) == 'true' ) {
if ( function_exists( 'woo_custom_navigation_output' ) ) { woo_custom_navigation_output( 'name=Woo Menu 1' ); }
} else { ?>
<?php if ( is_page() ) { $highlight = 'page_item'; } else { $highlight = 'page_item current_page_item'; } ?>
<li class="<?php echo esc_attr( $highlight ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
<?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=&link_before=<span>&link_after=</span>' ); ?>
<?php } ?>
</ul><!-- /#nav -->
<?php } ?>
</div><!-- /#navigation -->
<div id="nav1">
<div id="navigation" class="col-full">
<?php //woo_nav_inside(); ?>
<a href="<?php echo home_url(); ?>" class="nav-home"><span><?php _e( 'Home', 'woothemes' ); ?></span></a>
<?php
if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
wp_nav_menu( array( 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu' ) );
} else {
?>
<ul id="main-nav" class="nav fl">
<?php
if ( get_option( 'woo_custom_nav_menu' ) == 'true' ) {
if ( function_exists( 'woo_custom_navigation_output' ) ) { woo_custom_navigation_output( 'name=Woo Menu 1' ); }
} else { ?>
<?php if ( is_page() ) { $highlight = 'page_item'; } else { $highlight = 'page_item current_page_item'; } ?>
<li class="<?php echo esc_attr( $highlight ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
<?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
<?php } ?>
</ul><!-- /#nav -->
<?php } ?>
<a href="#top" class="nav-close"><span><?php _e('Return to Content', 'woothemes' ); ?></span></a>
</div><!-- /#navigation -->
</div>
<?php
woo_nav_after();
} // End woo_nav_beautiful_type()
?>