Custom Menu Wizard Widget - Version 2.0.5

Version Description

  • bugfix : prevent PHP warnings of Undefined index/offset
Download this release

Release Info

Developer wizzud
Plugin Icon 128x128 Custom Menu Wizard Widget
Version 2.0.5
Comparing to
See all releases

Code changes from version 2.0.4 to 2.0.5

custom-menu-wizard.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * custom-menu-wizard.css
3
- * Version: 2.0.4
4
  */
5
  /*widget admin style...*/
6
  /*NB .widget-content class is not present in accessibility mode*/
1
  /**
2
  * custom-menu-wizard.css
3
+ * Version: 2.0.5
4
  */
5
  /*widget admin style...*/
6
  /*NB .widget-content class is not present in accessibility mode*/
custom-menu-wizard.js CHANGED
@@ -1,5 +1,5 @@
1
  /* Plugin Name: Custom Menu Wizard
2
- * Version: 2.0.4
3
  * Author: Roger Barrett
4
  *
5
  * Script for controlling this widget's options (in Admin -> Widgets)
1
  /* Plugin Name: Custom Menu Wizard
2
+ * Version: 2.0.5
3
  * Author: Roger Barrett
4
  *
5
  * Script for controlling this widget's options (in Admin -> Widgets)
custom-menu-wizard.min.js CHANGED
@@ -1,5 +1,5 @@
1
  /* Plugin Name: Custom Menu Wizard
2
- * Version: 2.0.4
3
  * Author: Roger Barrett
4
  *
5
  * Script for controlling this widget's options (in Admin -> Widgets)
1
  /* Plugin Name: Custom Menu Wizard
2
+ * Version: 2.0.5
3
  * Author: Roger Barrett
4
  *
5
  * Script for controlling this widget's options (in Admin -> Widgets)
custom-menu-wizard.php CHANGED
@@ -3,13 +3,16 @@
3
  * Plugin Name: Custom Menu Wizard
4
  * Plugin URI: http://wordpress.org/plugins/custom-menu-wizard/
5
  * Description: Show any part of a custom menu in a Widget, or in content using a Shortcode. Customise the output with extra classes or html; filter by current menu item or a specific item; set a depth, show the parent(s), change the list style, etc. Use the included emulator to assist with the filter settings.
6
- * Version: 2.0.4
7
  * Author: Roger Barrett
8
  * Author URI: http://www.wizzud.com/
9
  * License: GPL2+
10
  */
11
 
12
  /*
 
 
 
13
  * v2.0.4 change log:
14
  * - fixed bug where clearing the container field failed to remove the container from the output
15
  * - remove WordPress's menu-item-has-children class (WP v3.7+) when the filtered item no longer has children
@@ -65,7 +68,7 @@
65
  * - moved the setting of 'disabled' attributes on INPUTs/SELECTs from PHP into javascript
66
  */
67
 
68
- $Custom_Menu_Wizard_Widget_Version = '2.0.4';
69
 
70
  /**
71
  * registers the widget and adds the shortcode
@@ -478,7 +481,7 @@ class Custom_Menu_Wizard_Walker extends Walker_Nav_Menu {
478
  //now we need to gather together all the 'keep' items from structure;
479
  //while doing so, we need to set up levels and kids, ready for adding classes...
480
  foreach( $structure as $k=>$v ){
481
- if( $v['keep'] ){
482
  $substructure[ $k ] = $v;
483
  //take a copy of the elements item...
484
  $substructure[ $k ]['element'] = $elements[ $v['element'] ];
@@ -487,7 +490,7 @@ class Custom_Menu_Wizard_Walker extends Walker_Nav_Menu {
487
  //any surviving parent (except the artificial level-0) should have submenu class set on it...
488
  array_shift( $v['ancestors'] ); //remove the level-0
489
  for( $i = count( $v['ancestors'] ) - 1; $i >= 0; $i-- ){
490
- if( $substructure[ $v['ancestors'][ $i ] ]['keep'] ){
491
  $substructure[ $v['ancestors'][ $i ] ]['kids']++;
492
  }else{
493
  //not a 'kept' ancestor so remove it...
3
  * Plugin Name: Custom Menu Wizard
4
  * Plugin URI: http://wordpress.org/plugins/custom-menu-wizard/
5
  * Description: Show any part of a custom menu in a Widget, or in content using a Shortcode. Customise the output with extra classes or html; filter by current menu item or a specific item; set a depth, show the parent(s), change the list style, etc. Use the included emulator to assist with the filter settings.
6
+ * Version: 2.0.5
7
  * Author: Roger Barrett
8
  * Author URI: http://www.wizzud.com/
9
  * License: GPL2+
10
  */
11
 
12
  /*
13
+ * v2.0.5 change log:
14
+ * - prevent PHP warnings of Undefined index/offset when building $substructure
15
+ *
16
  * v2.0.4 change log:
17
  * - fixed bug where clearing the container field failed to remove the container from the output
18
  * - remove WordPress's menu-item-has-children class (WP v3.7+) when the filtered item no longer has children
68
  * - moved the setting of 'disabled' attributes on INPUTs/SELECTs from PHP into javascript
69
  */
70
 
71
+ $Custom_Menu_Wizard_Widget_Version = '2.0.5';
72
 
73
  /**
74
  * registers the widget and adds the shortcode
481
  //now we need to gather together all the 'keep' items from structure;
482
  //while doing so, we need to set up levels and kids, ready for adding classes...
483
  foreach( $structure as $k=>$v ){
484
+ if( $k > 0 && $v['keep'] ){
485
  $substructure[ $k ] = $v;
486
  //take a copy of the elements item...
487
  $substructure[ $k ]['element'] = $elements[ $v['element'] ];
490
  //any surviving parent (except the artificial level-0) should have submenu class set on it...
491
  array_shift( $v['ancestors'] ); //remove the level-0
492
  for( $i = count( $v['ancestors'] ) - 1; $i >= 0; $i-- ){
493
+ if( isset( $substructure[ $v['ancestors'][ $i ] ] ) ){
494
  $substructure[ $v['ancestors'][ $i ] ]['kids']++;
495
  }else{
496
  //not a 'kept' ancestor so remove it...
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wizzud
3
  Tags: menu,widget,widgets,navigation,nav,custom menus,custom menu,partial menu,menu level,menu branch
4
  Requires at least: 3.0.1
5
  Tested up to: 3.8
6
- Stable tag: 2.0.4
7
  License: GPLv2 or Later
8
 
9
  Show branches or levels of your menu in a widget, or in content using a shortcode, with full customisation.
@@ -26,11 +26,11 @@ Features include:
26
  * Add/specify custom class(es) for the widget block, the menu container, and the menu itself
27
  * Modify the link's output with additional HTML around the link's text and/or the link element itself
28
  * Use Ordered Lists (OL) for the top and/or sub levels instead of Unordered Lists (UL)
29
- * *As of v1.1.0* : Select a branch based on the ultimate ancestor (root level) of the "current" item
30
- * *As of v1.2.0* : Shortcode, [custom_menu_wizard], available to run the widget from within content
31
- * *As of v2.0.0* : Make the output conditional upon the "current" item appearing in the selected/included items
32
- * *As of v2.0.0* : Specify specific menu items
33
- * *As of v2.0.0* : Use the widget's interactive "assist" to help with the widget settings or shortcode definition
34
 
35
  Documentation for the Widget Options, and the associated Shortcode Parameters, can be found under
36
  [Other Notes](http://wordpress.org/plugins/custom-menu-wizard/other_notes/).
@@ -489,6 +489,10 @@ It was a close call, but since the Output options can extend the final list - an
489
 
490
  == Changelog ==
491
 
 
 
 
 
492
  = 2.0.4 =
493
 
494
  * bugfix : clearing the container field failed to remove the container from the output
@@ -589,6 +593,10 @@ Initial release
589
 
590
  == Upgrade Notice ==
591
 
 
 
 
 
592
  = 2.0.4 =
593
 
594
  Fixed a bug that prevented the container field being removed, and added removal of the menu-item-has-children class when the filtered item no longer has children.
3
  Tags: menu,widget,widgets,navigation,nav,custom menus,custom menu,partial menu,menu level,menu branch
4
  Requires at least: 3.0.1
5
  Tested up to: 3.8
6
+ Stable tag: 2.0.5
7
  License: GPLv2 or Later
8
 
9
  Show branches or levels of your menu in a widget, or in content using a shortcode, with full customisation.
26
  * Add/specify custom class(es) for the widget block, the menu container, and the menu itself
27
  * Modify the link's output with additional HTML around the link's text and/or the link element itself
28
  * Use Ordered Lists (OL) for the top and/or sub levels instead of Unordered Lists (UL)
29
+ * Select a branch based on the ultimate ancestor (root level) of the "current" item
30
+ * Shortcode, [custom_menu_wizard], available to run the widget from within content
31
+ * Make the output conditional upon the "current" item appearing in the selected/included items
32
+ * Specify specific menu items
33
+ * Use the widget's interactive "assist" to help with the widget settings or shortcode definition
34
 
35
  Documentation for the Widget Options, and the associated Shortcode Parameters, can be found under
36
  [Other Notes](http://wordpress.org/plugins/custom-menu-wizard/other_notes/).
489
 
490
  == Changelog ==
491
 
492
+ = 2.0.5 =
493
+
494
+ * bugfix : prevent PHP warnings of Undefined index/offset
495
+
496
  = 2.0.4 =
497
 
498
  * bugfix : clearing the container field failed to remove the container from the output
593
 
594
  == Upgrade Notice ==
595
 
596
+ = 2.0.5 =
597
+
598
+ Fixed a bug to prevent PHP warnings of Undefined index/offset being output.
599
+
600
  = 2.0.4 =
601
 
602
  Fixed a bug that prevented the container field being removed, and added removal of the menu-item-has-children class when the filtered item no longer has children.