Version Description
- Added Menu Bar Font Size Setting
- Automatically enlarge toggle font size below 960px
- Added Indent Always Visible Submenus option (per menu)
- Added Smooth Scrolling on iOS
- Added ability to disable menu
- Added menu item size adjustments (global)
- Added Disable Link ability
Download this release
Release Info
Developer | sevenspark |
Plugin | ShiftNav – Responsive Mobile Menu |
Version | 0.2 |
Comparing to | |
See all releases |
Code changes from version 0.1 to 0.2
- admin/assets/admin.menu.css +9 -0
- admin/settings.config.php +47 -17
- admin/settings.menu.php +2 -2
- assets/css/less/panel.less +23 -6
- assets/css/less/responsive.less +6 -0
- assets/css/less/shift.less +8 -0
- assets/css/shiftnav.css +30 -6
- assets/js/shiftnav.js +3 -1
- includes/ShiftNavWalker.class.php +9 -2
- includes/functions.php +8 -1
- includes/shiftnav.api.php +39 -25
- readme.txt +11 -1
- shiftnav-responsive-mobile-menu.php +3 -4
admin/assets/admin.menu.css
CHANGED
@@ -75,6 +75,7 @@
|
|
75 |
text-decoration: none;
|
76 |
padding:2px 6px;
|
77 |
display:inline-block;
|
|
|
78 |
}
|
79 |
.shiftnav-up-link:hover{
|
80 |
color:#fff;
|
@@ -509,4 +510,12 @@
|
|
509 |
.shiftnav-js-check:hover .shiftnav-js-check-details{
|
510 |
height:140px;
|
511 |
visibility:visible;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
}
|
75 |
text-decoration: none;
|
76 |
padding:2px 6px;
|
77 |
display:inline-block;
|
78 |
+
margin-left:5px;
|
79 |
}
|
80 |
.shiftnav-up-link:hover{
|
81 |
color:#fff;
|
510 |
.shiftnav-js-check:hover .shiftnav-js-check-details{
|
511 |
height:140px;
|
512 |
visibility:visible;
|
513 |
+
}
|
514 |
+
|
515 |
+
|
516 |
+
.shiftnav-upgrade-link{
|
517 |
+
color:#666;
|
518 |
+
}
|
519 |
+
.shiftnav-upgrade-link:hover{
|
520 |
+
color:#35AC6A;
|
521 |
}
|
admin/settings.config.php
CHANGED
@@ -56,15 +56,22 @@ function shiftnav_get_settings_fields(){
|
|
56 |
*/
|
57 |
|
58 |
array(
|
59 |
-
'name'
|
60 |
-
'label'
|
61 |
-
'type'
|
62 |
-
'options'
|
63 |
-
'left'
|
64 |
-
'right'=> 'Right',
|
65 |
),
|
66 |
-
'default'
|
|
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
),
|
69 |
|
70 |
array(
|
@@ -74,7 +81,14 @@ function shiftnav_get_settings_fields(){
|
|
74 |
'options' => shiftnav_get_skin_ops(),
|
75 |
'default' => 'standard-dark',
|
76 |
//'options' => get_registered_nav_menus()
|
|
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
),
|
79 |
|
80 |
array(
|
@@ -86,6 +100,8 @@ function shiftnav_get_settings_fields(){
|
|
86 |
),
|
87 |
|
88 |
|
|
|
|
|
89 |
/*
|
90 |
array(
|
91 |
'name' => 'inherit_ubermenu_icons',
|
@@ -162,6 +178,14 @@ function shiftnav_get_settings_fields(){
|
|
162 |
'type' => 'color',
|
163 |
//'default' => '#eeeeee',
|
164 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
|
166 |
|
167 |
/*
|
@@ -189,6 +213,20 @@ function shiftnav_get_settings_fields(){
|
|
189 |
|
190 |
$fields[$prefix.'general'] = array(
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
array(
|
194 |
'name' => 'admin_tips',
|
@@ -222,17 +260,9 @@ function shiftnav_get_settings_fields(){
|
|
222 |
'default' => 'off'
|
223 |
),
|
224 |
|
|
|
|
|
225 |
/*
|
226 |
-
array(
|
227 |
-
'name' => 'radio',
|
228 |
-
'label' => __( 'Radio Button', 'shiftnav' ),
|
229 |
-
'desc' => __( 'A radio button', 'shiftnav' ),
|
230 |
-
'type' => 'radio',
|
231 |
-
'options' => array(
|
232 |
-
'yes' => 'Yes',
|
233 |
-
'no' => 'No'
|
234 |
-
)
|
235 |
-
),
|
236 |
array(
|
237 |
'name' => 'multicheck',
|
238 |
'label' => __( 'Multile checkbox', 'shiftnav' ),
|
56 |
*/
|
57 |
|
58 |
array(
|
59 |
+
'name' => 'edge',
|
60 |
+
'label' => __( 'Edge' , 'shiftnav' ),
|
61 |
+
'type' => 'radio',
|
62 |
+
'options' => array(
|
63 |
+
'left' => 'Left',
|
64 |
+
'right' => 'Right',
|
65 |
),
|
66 |
+
'default' => 'left'
|
67 |
+
),
|
68 |
|
69 |
+
array(
|
70 |
+
'name' => 'disable_menu',
|
71 |
+
'label' => __( 'Disable Menu' , 'shiftnav' ),
|
72 |
+
'desc' => __( 'Check this to disable the menu entirely; the panel can be used for custom content' , 'shiftnav' ),
|
73 |
+
'type' => 'checkbox',
|
74 |
+
'default' => 'off',
|
75 |
),
|
76 |
|
77 |
array(
|
81 |
'options' => shiftnav_get_skin_ops(),
|
82 |
'default' => 'standard-dark',
|
83 |
//'options' => get_registered_nav_menus()
|
84 |
+
),
|
85 |
|
86 |
+
array(
|
87 |
+
'name' => 'indent_submenus',
|
88 |
+
'label' => __( 'Indent Always Visible Submenus' , 'shiftnav' ),
|
89 |
+
'desc' => __( 'Check this to indent submenu items of always-visible submenus' , 'shiftnav' ),
|
90 |
+
'type' => 'checkbox',
|
91 |
+
'default' => 'off',
|
92 |
),
|
93 |
|
94 |
array(
|
100 |
),
|
101 |
|
102 |
|
103 |
+
|
104 |
+
|
105 |
/*
|
106 |
array(
|
107 |
'name' => 'inherit_ubermenu_icons',
|
178 |
'type' => 'color',
|
179 |
//'default' => '#eeeeee',
|
180 |
),
|
181 |
+
|
182 |
+
array(
|
183 |
+
'name' => 'font_size',
|
184 |
+
'label' => __( 'Font Size', 'shiftnav' ),
|
185 |
+
'desc' => __( 'Override the default font size of the toggle bar by setting a value here.', 'shiftnav' ),
|
186 |
+
'type' => 'text',
|
187 |
+
'default' => ''
|
188 |
+
),
|
189 |
|
190 |
|
191 |
/*
|
213 |
|
214 |
$fields[$prefix.'general'] = array(
|
215 |
|
216 |
+
|
217 |
+
array(
|
218 |
+
'name' => 'target_size',
|
219 |
+
'label' => __( 'Button Size', 'shiftnav' ),
|
220 |
+
'desc' => __( 'The size of the padding on the links in the menu. The larger the setting, the easier to click; but fewer menu items will appear on the screen at a time.', 'shiftnav' ),
|
221 |
+
'type' => 'radio',
|
222 |
+
'options' => array(
|
223 |
+
'default' => 'Default',
|
224 |
+
'medium' => 'Medium',
|
225 |
+
'large' => 'Large',
|
226 |
+
'enormous' => 'Enormous',
|
227 |
+
),
|
228 |
+
'default' => 'default',
|
229 |
+
),
|
230 |
|
231 |
array(
|
232 |
'name' => 'admin_tips',
|
260 |
'default' => 'off'
|
261 |
),
|
262 |
|
263 |
+
|
264 |
+
|
265 |
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
array(
|
267 |
'name' => 'multicheck',
|
268 |
'label' => __( 'Multile checkbox', 'shiftnav' ),
|
admin/settings.menu.php
CHANGED
@@ -38,7 +38,7 @@ function shiftnav_menu_item_settings_panel(){
|
|
38 |
|
39 |
<div class="shiftnav-menu-item-settings-topper">
|
40 |
<i class="fa fa-cogs"></i> SHIFTNAV SETTINGS
|
41 |
-
<?php if( !SHIFTNAV_PRO ): ?><a target="_blank" href="http://goo.gl/
|
42 |
</div>
|
43 |
|
44 |
<div class="shiftnav-menu-item-panel shiftnav-menu-item-panel-negative">
|
@@ -164,7 +164,7 @@ add_action( 'admin_footer-nav-menus.php' , 'shiftnav_menu_item_settings_panel');
|
|
164 |
function shiftnav_show_menu_item_setting( $setting ){
|
165 |
|
166 |
if( isset( $setting['pro_only'] ) && $setting['pro_only'] ){
|
167 |
-
echo 'Upgrade to ShiftNav Pro to use this feature.';
|
168 |
return;
|
169 |
}
|
170 |
|
38 |
|
39 |
<div class="shiftnav-menu-item-settings-topper">
|
40 |
<i class="fa fa-cogs"></i> SHIFTNAV SETTINGS
|
41 |
+
<?php if( !SHIFTNAV_PRO ): ?><a target="_blank" href="http://goo.gl/7jzDSQ" class="shiftnav-up-link"><i class="fa fa-rocket"></i> Go Pro</a><?php endif; ?>
|
42 |
</div>
|
43 |
|
44 |
<div class="shiftnav-menu-item-panel shiftnav-menu-item-panel-negative">
|
164 |
function shiftnav_show_menu_item_setting( $setting ){
|
165 |
|
166 |
if( isset( $setting['pro_only'] ) && $setting['pro_only'] ){
|
167 |
+
echo '<a class="shiftnav-upgrade-link" target="_blank" href="http://goo.gl/9UuoWS">Upgrade to ShiftNav Pro</a> to use this feature.';
|
168 |
return;
|
169 |
}
|
170 |
|
assets/css/less/panel.less
CHANGED
@@ -12,6 +12,7 @@
|
|
12 |
z-index:6000;
|
13 |
overflow-y:auto;
|
14 |
overflow-x:hidden;
|
|
|
15 |
|
16 |
-webkit-transition: -webkit-transform 0.5s;
|
17 |
-moz-transition: -moz-transform 0.5s;
|
@@ -111,7 +112,7 @@
|
|
111 |
.shiftnav ul.shiftnav-menu li.shiftnav-retract > .shiftnav-target{
|
112 |
display:block;
|
113 |
padding:16px 25px;
|
114 |
-
padding:
|
115 |
line-height:300%;
|
116 |
text-decoration: none;
|
117 |
position:relative;
|
@@ -138,11 +139,10 @@
|
|
138 |
.shiftnav ul.shiftnav-menu li.shiftnav-sub-shift li.shiftnav-retract{
|
139 |
display:block;
|
140 |
}
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
*/
|
146 |
.shiftnav.shiftnav-sub-shift-active ul.shiftnav-menu > li.menu-item{
|
147 |
/*margin-left:100%;*/
|
148 |
left:100%;
|
@@ -152,3 +152,20 @@
|
|
152 |
left:0;
|
153 |
}
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
z-index:6000;
|
13 |
overflow-y:auto;
|
14 |
overflow-x:hidden;
|
15 |
+
-webkit-overflow-scrolling:touch;
|
16 |
|
17 |
-webkit-transition: -webkit-transform 0.5s;
|
18 |
-moz-transition: -moz-transform 0.5s;
|
112 |
.shiftnav ul.shiftnav-menu li.shiftnav-retract > .shiftnav-target{
|
113 |
display:block;
|
114 |
padding:16px 25px;
|
115 |
+
padding:6px 25px;
|
116 |
line-height:300%;
|
117 |
text-decoration: none;
|
118 |
position:relative;
|
139 |
.shiftnav ul.shiftnav-menu li.shiftnav-sub-shift li.shiftnav-retract{
|
140 |
display:block;
|
141 |
}
|
142 |
+
|
143 |
+
|
144 |
+
/* Menu Items */
|
145 |
+
|
|
|
146 |
.shiftnav.shiftnav-sub-shift-active ul.shiftnav-menu > li.menu-item{
|
147 |
/*margin-left:100%;*/
|
148 |
left:100%;
|
152 |
left:0;
|
153 |
}
|
154 |
|
155 |
+
/* Medium */
|
156 |
+
.shiftnav ul.shiftnav-menu.shiftnav-targets-medium li.menu-item > .shiftnav-target{
|
157 |
+
padding-top:10px !important;
|
158 |
+
padding-bottom:10px !important;
|
159 |
+
}
|
160 |
+
|
161 |
+
/* Large */
|
162 |
+
.shiftnav ul.shiftnav-menu.shiftnav-targets-large li.menu-item > .shiftnav-target{
|
163 |
+
padding-top:16px !important;
|
164 |
+
padding-bottom:16px !important;
|
165 |
+
}
|
166 |
+
|
167 |
+
/* Enormous */
|
168 |
+
.shiftnav ul.shiftnav-menu.shiftnav-targets-enormous li.menu-item > .shiftnav-target{
|
169 |
+
padding-top:24px !important;
|
170 |
+
padding-bottom:24px !important;
|
171 |
+
}
|
assets/css/less/responsive.less
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
/* RESPONSIVENESS */
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
@media only screen and (max-width:479px){
|
4 |
.shiftnav{
|
5 |
width:85%;
|
1 |
/* RESPONSIVENESS */
|
2 |
|
3 |
+
@media only screen and (max-width:960px){
|
4 |
+
#shiftnav-toggle-main{
|
5 |
+
font-size:16px;
|
6 |
+
}
|
7 |
+
}
|
8 |
+
|
9 |
@media only screen and (max-width:479px){
|
10 |
.shiftnav{
|
11 |
width:85%;
|
assets/css/less/shift.less
CHANGED
@@ -13,4 +13,12 @@
|
|
13 |
-ms-transform: translateX(-290px);
|
14 |
-o-transform: translateX(-290px);
|
15 |
transform: translateX(-290px);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
13 |
-ms-transform: translateX(-290px);
|
14 |
-o-transform: translateX(-290px);
|
15 |
transform: translateX(-290px);
|
16 |
+
}
|
17 |
+
|
18 |
+
.shiftnav-open #shiftnav-toggle-main{
|
19 |
+
-webkit-transition-delay: .02s;
|
20 |
+
-moz-transition-delay: .02s;
|
21 |
+
-ms-transition-delay: .02s;
|
22 |
+
-o-transition-delay: .02s;
|
23 |
+
transition-delay: .02s;
|
24 |
}
|
assets/css/shiftnav.css
CHANGED
@@ -91,6 +91,13 @@ body.shiftnav-enabled.shiftnav-transition.admin-bar {
|
|
91 |
-o-transform: translateX(-290px);
|
92 |
transform: translateX(-290px);
|
93 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
body.admin-bar #shiftnav-toggle-main,
|
95 |
body.admin-bar .shiftnav {
|
96 |
top: 32px;
|
@@ -163,6 +170,7 @@ body.admin-bar .shiftnav {
|
|
163 |
z-index: 6000;
|
164 |
overflow-y: auto;
|
165 |
overflow-x: hidden;
|
|
|
166 |
-webkit-transition: -webkit-transform 0.5s;
|
167 |
-moz-transition: -moz-transform 0.5s;
|
168 |
-ms-transition: -ms-transform 0.5s;
|
@@ -251,7 +259,7 @@ body.admin-bar .shiftnav {
|
|
251 |
.shiftnav ul.shiftnav-menu li.shiftnav-retract > .shiftnav-target {
|
252 |
display: block;
|
253 |
padding: 16px 25px;
|
254 |
-
padding:
|
255 |
line-height: 300%;
|
256 |
text-decoration: none;
|
257 |
position: relative;
|
@@ -277,11 +285,7 @@ body.admin-bar .shiftnav {
|
|
277 |
.shiftnav ul.shiftnav-menu li.shiftnav-sub-shift li.shiftnav-retract {
|
278 |
display: block;
|
279 |
}
|
280 |
-
/*
|
281 |
-
.shiftnav ul.shiftnav-menu ul.sub-menu li.menu-item > a{ padding-left:50px; }
|
282 |
-
.shiftnav ul.shiftnav-menu ul.sub-menu ul.sub-menu li.menu-item > a{ padding-left:75px; }
|
283 |
-
.shiftnav ul.shiftnav-menu ul.sub-menu ul.sub-menu ul.sub-menu li.menu-item > a{ padding-left:100px; }
|
284 |
-
*/
|
285 |
.shiftnav.shiftnav-sub-shift-active ul.shiftnav-menu > li.menu-item {
|
286 |
/*margin-left:100%;*/
|
287 |
|
@@ -292,7 +296,27 @@ body.admin-bar .shiftnav {
|
|
292 |
|
293 |
left: 0;
|
294 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
/* RESPONSIVENESS */
|
|
|
|
|
|
|
|
|
|
|
296 |
@media only screen and (max-width: 479px) {
|
297 |
.shiftnav {
|
298 |
width: 85%;
|
91 |
-o-transform: translateX(-290px);
|
92 |
transform: translateX(-290px);
|
93 |
}
|
94 |
+
.shiftnav-open #shiftnav-toggle-main {
|
95 |
+
-webkit-transition-delay: .02s;
|
96 |
+
-moz-transition-delay: .02s;
|
97 |
+
-ms-transition-delay: .02s;
|
98 |
+
-o-transition-delay: .02s;
|
99 |
+
transition-delay: .02s;
|
100 |
+
}
|
101 |
body.admin-bar #shiftnav-toggle-main,
|
102 |
body.admin-bar .shiftnav {
|
103 |
top: 32px;
|
170 |
z-index: 6000;
|
171 |
overflow-y: auto;
|
172 |
overflow-x: hidden;
|
173 |
+
-webkit-overflow-scrolling: touch;
|
174 |
-webkit-transition: -webkit-transform 0.5s;
|
175 |
-moz-transition: -moz-transform 0.5s;
|
176 |
-ms-transition: -ms-transform 0.5s;
|
259 |
.shiftnav ul.shiftnav-menu li.shiftnav-retract > .shiftnav-target {
|
260 |
display: block;
|
261 |
padding: 16px 25px;
|
262 |
+
padding: 6px 25px;
|
263 |
line-height: 300%;
|
264 |
text-decoration: none;
|
265 |
position: relative;
|
285 |
.shiftnav ul.shiftnav-menu li.shiftnav-sub-shift li.shiftnav-retract {
|
286 |
display: block;
|
287 |
}
|
288 |
+
/* Menu Items */
|
|
|
|
|
|
|
|
|
289 |
.shiftnav.shiftnav-sub-shift-active ul.shiftnav-menu > li.menu-item {
|
290 |
/*margin-left:100%;*/
|
291 |
|
296 |
|
297 |
left: 0;
|
298 |
}
|
299 |
+
/* Medium */
|
300 |
+
.shiftnav ul.shiftnav-menu.shiftnav-targets-medium li.menu-item > .shiftnav-target {
|
301 |
+
padding-top: 10px !important;
|
302 |
+
padding-bottom: 10px !important;
|
303 |
+
}
|
304 |
+
/* Large */
|
305 |
+
.shiftnav ul.shiftnav-menu.shiftnav-targets-large li.menu-item > .shiftnav-target {
|
306 |
+
padding-top: 16px !important;
|
307 |
+
padding-bottom: 16px !important;
|
308 |
+
}
|
309 |
+
/* Enormous */
|
310 |
+
.shiftnav ul.shiftnav-menu.shiftnav-targets-enormous li.menu-item > .shiftnav-target {
|
311 |
+
padding-top: 24px !important;
|
312 |
+
padding-bottom: 24px !important;
|
313 |
+
}
|
314 |
/* RESPONSIVENESS */
|
315 |
+
@media only screen and (max-width: 960px) {
|
316 |
+
#shiftnav-toggle-main {
|
317 |
+
font-size: 16px;
|
318 |
+
}
|
319 |
+
}
|
320 |
@media only screen and (max-width: 479px) {
|
321 |
.shiftnav {
|
322 |
width: 85%;
|
assets/js/shiftnav.js
CHANGED
@@ -119,7 +119,9 @@
|
|
119 |
|
120 |
//Set retractor heights
|
121 |
this.$shiftnav.find( '.shiftnav-submenu-activation' ).each( function(){
|
122 |
-
|
|
|
|
|
123 |
//$( this ).css( 'height' , $( this ).parent( '.menu-item' ).height() );
|
124 |
});
|
125 |
|
119 |
|
120 |
//Set retractor heights
|
121 |
this.$shiftnav.find( '.shiftnav-submenu-activation' ).each( function(){
|
122 |
+
var length = $( this ).outerHeight();
|
123 |
+
$( this ).css( { 'height' : length , 'width' : length } );
|
124 |
+
|
125 |
//$( this ).css( 'height' , $( this ).parent( '.menu-item' ).height() );
|
126 |
});
|
127 |
|
includes/ShiftNavWalker.class.php
CHANGED
@@ -128,6 +128,9 @@ class ShiftNavWalker extends Walker_Nav_Menu {
|
|
128 |
$icon = '<i class="shiftnav-icon '.$data['icon'].'"></i>';
|
129 |
}
|
130 |
|
|
|
|
|
|
|
131 |
|
132 |
|
133 |
/**
|
@@ -184,6 +187,7 @@ class ShiftNavWalker extends Walker_Nav_Menu {
|
|
184 |
|
185 |
//Merge ShiftNav atts
|
186 |
$atts = array_merge( $atts , $shiftnav_atts );
|
|
|
187 |
|
188 |
$attributes = '';
|
189 |
foreach ( $atts as $attr => $value ) {
|
@@ -193,14 +197,17 @@ class ShiftNavWalker extends Walker_Nav_Menu {
|
|
193 |
}
|
194 |
}
|
195 |
|
|
|
|
|
|
|
196 |
$item_output = $args->before;
|
197 |
-
$item_output .= '<
|
198 |
/** This filter is documented in wp-includes/post-template.php */
|
199 |
$title = apply_filters( 'the_title', $item->title, $item->ID );
|
200 |
if( $icon ) $title = '<span class="shiftnav-target-text">'.$title.'</span>';
|
201 |
$item_output .= $args->link_before . $icon . $title . $args->link_after;
|
202 |
|
203 |
-
$item_output .= '</
|
204 |
|
205 |
if( $has_sub ){
|
206 |
switch( $submenu_type ){
|
128 |
$icon = '<i class="shiftnav-icon '.$data['icon'].'"></i>';
|
129 |
}
|
130 |
|
131 |
+
//Disable Link
|
132 |
+
$disable_link = isset( $data['disable_link'] ) && ( $data['disable_link'] == 'on' ) ? true : false;
|
133 |
+
|
134 |
|
135 |
|
136 |
/**
|
187 |
|
188 |
//Merge ShiftNav atts
|
189 |
$atts = array_merge( $atts , $shiftnav_atts );
|
190 |
+
if( $disable_link ) unset( $atts['href'] ); //remove href for disabled links
|
191 |
|
192 |
$attributes = '';
|
193 |
foreach ( $atts as $attr => $value ) {
|
197 |
}
|
198 |
}
|
199 |
|
200 |
+
$el = 'a';
|
201 |
+
if( $disable_link ) $el = 'span';
|
202 |
+
|
203 |
$item_output = $args->before;
|
204 |
+
$item_output .= '<'.$el.' class="shiftnav-target" '. $attributes .'>';
|
205 |
/** This filter is documented in wp-includes/post-template.php */
|
206 |
$title = apply_filters( 'the_title', $item->title, $item->ID );
|
207 |
if( $icon ) $title = '<span class="shiftnav-target-text">'.$title.'</span>';
|
208 |
$item_output .= $args->link_before . $icon . $title . $args->link_after;
|
209 |
|
210 |
+
$item_output .= '</'.$el.'>';
|
211 |
|
212 |
if( $has_sub ){
|
213 |
switch( $submenu_type ){
|
includes/functions.php
CHANGED
@@ -29,11 +29,18 @@ function shiftnav_inject_css(){
|
|
29 |
if( $hide_theme_menu != '' ){
|
30 |
$toggle_breakpoint = ( (int) $toggle_breakpoint ) - 1;
|
31 |
$css.= "\t@media only screen and (max-width:{$toggle_breakpoint}px){ ";
|
32 |
-
$css.= "$hide_theme_menu{ display:none !important; }";
|
33 |
$css.= "}\n";
|
34 |
}
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
/**
|
39 |
*
|
29 |
if( $hide_theme_menu != '' ){
|
30 |
$toggle_breakpoint = ( (int) $toggle_breakpoint ) - 1;
|
31 |
$css.= "\t@media only screen and (max-width:{$toggle_breakpoint}px){ ";
|
32 |
+
$css.= "$hide_theme_menu{ display:none !important; } ";
|
33 |
$css.= "}\n";
|
34 |
}
|
35 |
}
|
36 |
|
37 |
+
$font_size = shiftnav_op( 'font_size' , 'togglebar' );
|
38 |
+
if( $font_size != '' ){
|
39 |
+
if( is_numeric( $font_size ) ) $font_size.= 'px';
|
40 |
+
$css.= "\t#shiftnav-toggle-main{ font-size: $font_size !important; }";
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
|
45 |
/**
|
46 |
*
|
includes/shiftnav.api.php
CHANGED
@@ -27,35 +27,49 @@ function shiftnav( $id , $settings = array() ){
|
|
27 |
|
28 |
do_action( 'shiftnav_before' , $id );
|
29 |
|
30 |
-
$
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
else if( $theme_location != '_none' ){
|
43 |
-
$args['theme_location'] = $theme_location;
|
44 |
-
if( !has_nav_menu( $theme_location ) ){
|
45 |
|
46 |
-
shiftnav_count_menus();
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
52 |
-
}
|
53 |
-
else{
|
54 |
-
shiftnav_count_menus();
|
55 |
-
shiftnav_show_tip( 'Please <a href="'.admin_url( 'themes.php?page=shiftnav-settings#shiftnav_'.$id ).'">set a Theme Location or Menu</a> for this instance' );
|
56 |
-
}
|
57 |
|
58 |
-
|
|
|
|
|
59 |
|
60 |
do_action( 'shiftnav_after' , $id );
|
61 |
|
27 |
|
28 |
do_action( 'shiftnav_before' , $id );
|
29 |
|
30 |
+
$disable_menu = shiftnav_op( 'disable_menu' , $id ) == 'on' ? true : false;
|
31 |
+
|
32 |
+
if( !$disable_menu ){
|
33 |
+
|
34 |
+
$args = array(
|
35 |
+
'container_class' => 'shiftnav-nav', //$container_class, //shiftnav-transition-standard
|
36 |
+
//'container_id' => $id,
|
37 |
+
'container' => $container,
|
38 |
+
'menu_class' => 'shiftnav-menu',
|
39 |
+
'walker' => new ShiftNavWalker,
|
40 |
+
'fallback_cb' => 'shiftnav_fallback'
|
41 |
+
);
|
|
|
|
|
|
|
42 |
|
|
|
43 |
|
44 |
+
//Target size
|
45 |
+
$args['menu_class'].= ' shiftnav-targets-'.shiftnav_op( 'target_size' , 'general' );
|
46 |
+
|
47 |
+
//Submenu indent
|
48 |
+
if( shiftnav_op( 'indent_submenus' , $id ) == 'on' ) $args['menu_class'].= ' shiftnav-indent-subs';
|
49 |
+
|
50 |
+
|
51 |
+
if( $menu != '_none' ){
|
52 |
+
$args['menu'] = $menu;
|
53 |
+
}
|
54 |
+
else if( $theme_location != '_none' ){
|
55 |
+
$args['theme_location'] = $theme_location;
|
56 |
+
if( !has_nav_menu( $theme_location ) ){
|
57 |
+
|
58 |
+
shiftnav_count_menus();
|
59 |
+
|
60 |
+
$locs = get_registered_nav_menus();
|
61 |
+
$loc = $locs[$theme_location];
|
62 |
+
shiftnav_show_tip( 'Please <a href="'.admin_url('nav-menus.php?action=locations').'">assign a menu</a> to the <strong>'.$loc.'</strong> theme location' );
|
63 |
+
}
|
64 |
+
}
|
65 |
+
else{
|
66 |
+
shiftnav_count_menus();
|
67 |
+
shiftnav_show_tip( 'Please <a href="'.admin_url( 'themes.php?page=shiftnav-settings#shiftnav_'.$id ).'">set a Theme Location or Menu</a> for this instance' );
|
68 |
}
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
+
wp_nav_menu( $args );
|
71 |
+
|
72 |
+
}
|
73 |
|
74 |
do_action( 'shiftnav_after' , $id );
|
75 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://shiftnav.io/pro
|
|
4 |
Tags: responsive, menu, navigation, mobile, off-canvas, app, slide, sidebar
|
5 |
Requires at least: 3.8.1
|
6 |
Tested up to: 3.8.1
|
7 |
-
Stable tag: 0.
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -42,6 +42,16 @@ None. Yet.
|
|
42 |
|
43 |
== Changelog ==
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
= 0.1 =
|
46 |
|
47 |
Initial Beta Release
|
4 |
Tags: responsive, menu, navigation, mobile, off-canvas, app, slide, sidebar
|
5 |
Requires at least: 3.8.1
|
6 |
Tested up to: 3.8.1
|
7 |
+
Stable tag: 0.2
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
42 |
|
43 |
== Changelog ==
|
44 |
|
45 |
+
= 0.2 =
|
46 |
+
|
47 |
+
* Added Menu Bar Font Size Setting
|
48 |
+
* Automatically enlarge toggle font size below 960px
|
49 |
+
* Added Indent Always Visible Submenus option (per menu)
|
50 |
+
* Added Smooth Scrolling on iOS
|
51 |
+
* Added ability to disable menu
|
52 |
+
* Added menu item size adjustments (global)
|
53 |
+
* Added Disable Link ability
|
54 |
+
|
55 |
= 0.1 =
|
56 |
|
57 |
Initial Beta Release
|
shiftnav-responsive-mobile-menu.php
CHANGED
@@ -6,7 +6,7 @@ Description: An off-canvas mobile menu for WordPress
|
|
6 |
Author: Chris Mavricos, SevenSpark
|
7 |
Author URI: http://sevenspark.com
|
8 |
License: GPLv2
|
9 |
-
Version: 0.
|
10 |
|
11 |
Copyright (C) 2014 Chris Mavricos, SevenSpark
|
12 |
*/
|
@@ -168,9 +168,8 @@ final class ShiftNav {
|
|
168 |
elseif ( defined( 'SHIFTNAV_PRO' ) && SHIFTNAV_PRO ) :
|
169 |
|
170 |
function deactivate_shiftnav() {
|
171 |
-
if ( is_plugin_active('shiftnav/shiftnav.php') ) {
|
172 |
-
|
173 |
-
deactivate_plugins('shiftnav/shiftnav.php');
|
174 |
}
|
175 |
}
|
176 |
add_action( 'admin_init', 'deactivate_shiftnav' );
|
6 |
Author: Chris Mavricos, SevenSpark
|
7 |
Author URI: http://sevenspark.com
|
8 |
License: GPLv2
|
9 |
+
Version: 0.2
|
10 |
|
11 |
Copyright (C) 2014 Chris Mavricos, SevenSpark
|
12 |
*/
|
168 |
elseif ( defined( 'SHIFTNAV_PRO' ) && SHIFTNAV_PRO ) :
|
169 |
|
170 |
function deactivate_shiftnav() {
|
171 |
+
if ( is_plugin_active('shiftnav-responsive-mobile-menu/shiftnav-responsive-mobile-menu.php') ) {
|
172 |
+
deactivate_plugins('shiftnav-responsive-mobile-menu/shiftnav-responsive-mobile-menu.php');
|
|
|
173 |
}
|
174 |
}
|
175 |
add_action( 'admin_init', 'deactivate_shiftnav' );
|