Custom Menu Wizard Widget - Version 3.0.2

Version Description

  • bugfix : the shortcode display on new instances of the widget (in admin) did not initially reflect the automatically-selected menu
Download this release

Release Info

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

Code changes from version 3.0.1 to 3.0.2

Files changed (3) hide show
  1. custom-menu-wizard.php +6 -3
  2. include/class.widget.php +5 -1
  3. readme.txt +18 -2
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: 3.0.1
7
  * Author: Roger Barrett
8
  * Author URI: http://www.wizzud.com/
9
  * License: GPL2+
10
  */
11
  defined( 'ABSPATH' ) or exit();
12
  /*
 
 
 
13
  * v3.0.1 change log
14
  * - fixed bug in determination of pre-existing legacy widgets versus brand new widget instances
15
  * - replaced widget property _cmw_allow_legacy_update with a filter, custom_menu_wizard_prevent_legacy_updates : return TRUE to prevent updates of legacy widgets
@@ -117,7 +120,7 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
117
  //declare the main plugin class...
118
  class Custom_Menu_Wizard_Plugin {
119
 
120
- public static $version = '3.0.1';
121
  protected static $instance;
122
 
123
  /**
@@ -161,7 +164,7 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
161
  public function enqueue_scripts(){
162
 
163
  $min = defined( 'WP_DEBUG' ) && WP_DEBUG ? '' : '.min';
164
- wp_enqueue_script( 'custom-menu-wizard-plugin-script', plugins_url( "/custom-menu-wizard$min.js", __FILE__ ), array('jquery-ui-dialog'), self::$version );
165
 
166
  } //end enqueue_scripts()
167
 
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: 3.0.2
7
  * Author: Roger Barrett
8
  * Author URI: http://www.wizzud.com/
9
  * License: GPL2+
10
  */
11
  defined( 'ABSPATH' ) or exit();
12
  /*
13
+ * v3.0.2 change log
14
+ * - fixed bug where the shortcode shown on new instances didn't initially reflect the automatically selected menu
15
+ *
16
  * v3.0.1 change log
17
  * - fixed bug in determination of pre-existing legacy widgets versus brand new widget instances
18
  * - replaced widget property _cmw_allow_legacy_update with a filter, custom_menu_wizard_prevent_legacy_updates : return TRUE to prevent updates of legacy widgets
120
  //declare the main plugin class...
121
  class Custom_Menu_Wizard_Plugin {
122
 
123
+ public static $version = '3.0.2';
124
  protected static $instance;
125
 
126
  /**
164
  public function enqueue_scripts(){
165
 
166
  $min = defined( 'WP_DEBUG' ) && WP_DEBUG ? '' : '.min';
167
+ wp_enqueue_script( 'custom-menu-wizard-plugin-script', plugins_url( "/custom-menu-wizard$min.js", __FILE__ ), array('jquery-ui-dialog'), self::$version, true );
168
 
169
  } //end enqueue_scripts()
170
 
include/class.widget.php CHANGED
@@ -603,7 +603,8 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
603
 
604
  <?php $this->cmw_close_a_field_section(); ?>
605
 
606
- <div class="cmw-shortcode-wrap"><code class="widget-<?php echo $this->id_base; ?>-shortcode ui-corner-all" title="<?php _e('shortcode'); ?>"><?php echo $this->cmw_shortcode( $instance ); ?></code></div>
 
607
 
608
  </div>
609
  <?php
@@ -1107,6 +1108,9 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
1107
  //reset levels of selected optgroup to be the max levels of any group...
1108
  $rtn['selectedLevels'] = $rtn['maxlevel'];
1109
  }
 
 
 
1110
  }
1111
  return $rtn;
1112
 
603
 
604
  <?php $this->cmw_close_a_field_section(); ?>
605
 
606
+ <div class="cmw-shortcode-wrap"><code class="widget-<?php echo $this->id_base; ?>-shortcode ui-corner-all"
607
+ title="<?php _e('shortcode'); ?>"><?php echo $this->cmw_shortcode( array_merge( $instance, array( 'menu' => $menus['selectedMenu'] ) ) ); ?></code></div>
608
 
609
  </div>
610
  <?php
1108
  //reset levels of selected optgroup to be the max levels of any group...
1109
  $rtn['selectedLevels'] = $rtn['maxlevel'];
1110
  }
1111
+ //send the currently selected menu id back (may be different from the value when passed
1112
+ //in, if this is a new instance or if a menu set for an existing instance has been deleted)
1113
+ $rtn['selectedMenu'] = $selectedMenu;
1114
  }
1115
  return $rtn;
1116
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: menu,widget,widgets,navigation,nav,custom menus,custom menu,partial menu,current item,current page,menu level,menu branch,menu shortcode,menu widget,advanced,enhanced
5
  Requires at least: 3.6
6
  Tested up to: 3.9
7
- Stable tag: 3.0.1
8
  License: GPLv2 or Later
9
 
10
  Show branches or levels of your menu in a widget, or in content using a shortcode, with full customisation.
@@ -160,13 +160,23 @@ Filters are applied in the order they are presented.
160
 
161
  * **For Depth** *select*
162
 
163
- This the number of levels of the menu structure that will be considered for inclusion in the final output.
 
 
 
 
 
 
164
 
165
  * **Relative to Current Item** *checkbox*
166
 
167
  By default, `For Depth` (above) is relative to the first item found, but this may be overridden to be relative to the
168
  current menu item ***if*** `For Depth` is not unlimited **and** the current menu item can found within the selected menu.
169
  If the current menu item is not within the selected menu then it falls back to being relative to the first item found.
 
 
 
 
170
 
171
  ***Inclusions***
172
 
@@ -659,6 +669,9 @@ Note that output from this shortcode extension is restricted to users with edit_
659
 
660
  == Changelog ==
661
 
 
 
 
662
  = 3.0.1 =
663
  * bugfix : changed the determination of pre-existing legacy widgets versus brand new widget instances, to get round problems encountered when other plugins utilise the widget_form_callback filter to inject fields into a widget
664
  * addition : added a couple of filters
@@ -762,6 +775,9 @@ Note that output from this shortcode extension is restricted to users with edit_
762
 
763
  == Upgrade Notice ==
764
 
 
 
 
765
  = 3.0.1 =
766
  Fixed a bug that created new widget instances as legacy version rather than latest; only encountered when other installed plugins inject their own fields into widgets
767
  Also added a couple of filters.
4
  Tags: menu,widget,widgets,navigation,nav,custom menus,custom menu,partial menu,current item,current page,menu level,menu branch,menu shortcode,menu widget,advanced,enhanced
5
  Requires at least: 3.6
6
  Tested up to: 3.9
7
+ Stable tag: 3.0.2
8
  License: GPLv2 or Later
9
 
10
  Show branches or levels of your menu in a widget, or in content using a shortcode, with full customisation.
160
 
161
  * **For Depth** *select*
162
 
163
+ This the number of levels of the menu structure that will be considered for inclusion in the final output (in complete
164
+ ignorance of any subsequent Inclusions or Exclusions).
165
+
166
+ The first level of output is the starting level, regardless of
167
+ how that starting level is determined (see `Starting at` and `Relative to Current Item` options). So if you ask
168
+ for a Depth of 1 level, you get just the starting level; if you ask for a Depth of 2, you get the starting level and
169
+ the one below it.
170
 
171
  * **Relative to Current Item** *checkbox*
172
 
173
  By default, `For Depth` (above) is relative to the first item found, but this may be overridden to be relative to the
174
  current menu item ***if*** `For Depth` is not unlimited **and** the current menu item can found within the selected menu.
175
  If the current menu item is not within the selected menu then it falls back to being relative to the first item found.
176
+
177
+ Please note that the current item must also be within the constraints set by the `Starting at` option. In other words, if
178
+ current item is *above* the `Starting at` level in the menu structure then it will **not** be used to alter the determination of
179
+ Depth.
180
 
181
  ***Inclusions***
182
 
669
 
670
  == Changelog ==
671
 
672
+ = 3.0.2 =
673
+ * bugfix : the shortcode display on new instances of the widget (in admin) did not initially reflect the automatically-selected menu
674
+
675
  = 3.0.1 =
676
  * bugfix : changed the determination of pre-existing legacy widgets versus brand new widget instances, to get round problems encountered when other plugins utilise the widget_form_callback filter to inject fields into a widget
677
  * addition : added a couple of filters
775
 
776
  == Upgrade Notice ==
777
 
778
+ = 3.0.2 =
779
+ Fixed a bug where the shortcode displayed on new instances of the widget (in admin) did not initially reflect the automatically-selected menu
780
+
781
  = 3.0.1 =
782
  Fixed a bug that created new widget instances as legacy version rather than latest; only encountered when other installed plugins inject their own fields into widgets
783
  Also added a couple of filters.