Custom Menu Wizard Widget - Version 3.2.2

Version Description

  • bugfix : fixed initial widget display when adding new widget instance in the customizer
Download this release

Release Info

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

Code changes from version 3.2.1 to 3.2.2

custom-menu-wizard.php CHANGED
@@ -3,7 +3,7 @@
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.2.1
7
  * Author: Roger Barrett
8
  * Author URI: http://www.wizzud.com/
9
  * License: GPL2+
@@ -11,6 +11,9 @@
11
  */
12
  defined( 'ABSPATH' ) or exit();
13
  /*
 
 
 
14
  * v3.2.1 change log
15
  * - missing an echo statement for the update message
16
  *
@@ -167,7 +170,7 @@ if( !class_exists( 'Custom_Menu_Wizard_Plugin' ) ){
167
  //declare the main plugin class...
168
  class Custom_Menu_Wizard_Plugin {
169
 
170
- public static $version = '3.2.1';
171
  public static $script_handle = 'custom-menu-wizard-plugin-script';
172
  public static $widget_class = 'Custom_Menu_Wizard_Widget';
173
  protected static $instance;
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.2.2
7
  * Author: Roger Barrett
8
  * Author URI: http://www.wizzud.com/
9
  * License: GPL2+
11
  */
12
  defined( 'ABSPATH' ) or exit();
13
  /*
14
+ * v3.2.2 change log
15
+ * - fixed bug : fixed initial widget display when adding new widget instance in the customizer
16
+ *
17
  * v3.2.1 change log
18
  * - missing an echo statement for the update message
19
  *
170
  //declare the main plugin class...
171
  class Custom_Menu_Wizard_Plugin {
172
 
173
+ public static $version = '3.2.2';
174
  public static $script_handle = 'custom-menu-wizard-plugin-script';
175
  public static $widget_class = 'Custom_Menu_Wizard_Widget';
176
  protected static $instance;
doc/cmw-doc.html CHANGED
@@ -117,9 +117,9 @@ div > ul > li > ul, div > ol > li > ul {
117
  <p>
118
  <strong>Requires at least:</strong> 3.6</p>
119
  <p>
120
- <strong>Tested up to:</strong> 4.3</p>
121
  <p>
122
- <strong>Stable tag:</strong> 3.2.1</p>
123
  <p>
124
  <strong>License:</strong> GPLv2 or Later </p>
125
 
@@ -1209,7 +1209,13 @@ because Version 2 will <strong>not</strong> be supported beyond Version 3.</p>
1209
  </div></div></div></div> </div>
1210
  <div role="tabpanel" class="tab-pane fade" id="Changelog">
1211
  <h2>Changelog</h2>
1212
- <h4>3.2.1</h4>
 
 
 
 
 
 
1213
 
1214
  <ul>
1215
  <li>bugfix : missing echo statement for the update message</li>
117
  <p>
118
  <strong>Requires at least:</strong> 3.6</p>
119
  <p>
120
+ <strong>Tested up to:</strong> 4.3.1</p>
121
  <p>
122
+ <strong>Stable tag:</strong> 3.2.2</p>
123
  <p>
124
  <strong>License:</strong> GPLv2 or Later </p>
125
 
1209
  </div></div></div></div> </div>
1210
  <div role="tabpanel" class="tab-pane fade" id="Changelog">
1211
  <h2>Changelog</h2>
1212
+ <h4>3.2.2</h4>
1213
+
1214
+ <ul>
1215
+ <li>bugfix : fixed initial widget display when adding new widget instance in the customizer</li>
1216
+ </ul>
1217
+
1218
+ <h4>3.2.1</h4>
1219
 
1220
  <ul>
1221
  <li>bugfix : missing echo statement for the update message</li>
include/class.widget.php CHANGED
@@ -783,11 +783,22 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
783
  public function widget( $args, $instance ) {
784
 
785
  //call the legacy widget method for producing existing widgets that don't have a version number (old format)...
786
- if( empty( $instance['cmwv'] ) ){
787
  $this->cmw_legacy_widget( $args, $instance );
788
  return;
789
  }
790
 
 
 
 
 
 
 
 
 
 
 
 
791
  //sanitize $instance...
792
  $instance = self::cmw_settings( $instance, array(), __FUNCTION__ );
793
  //holds information determined by the walker...
@@ -1423,7 +1434,7 @@ class Custom_Menu_Wizard_Widget extends WP_Widget {
1423
  'switch_to' => '', //v3.1.0 (a [cmwizard .../] shortcode)
1424
  'menu_class' => 'menu-widget',
1425
  'widget_class' => '',
1426
- 'cmwv' => ''
1427
  ) as $k => $v ){
1428
 
1429
  $instance[ $k ] = isset( $from_instance[ $k ] ) ? strip_tags( trim( (string)$from_instance[ $k ] ) ) : $v;
783
  public function widget( $args, $instance ) {
784
 
785
  //call the legacy widget method for producing existing widgets that don't have a version number (old format)...
786
+ if( !empty( $instance ) && empty( $instance['cmwv'] ) ){
787
  $this->cmw_legacy_widget( $args, $instance );
788
  return;
789
  }
790
 
791
+ //if $instance is empty - as is the case when adding a new widget instance in the Customizer! -
792
+ //then find the first eligible custom menu and use that as the menu...
793
+ if( empty( $instance ) ){
794
+ $i = 0;
795
+ $menu = $this->cmw_get_custom_menus( $i );
796
+ $menu = reset( $menu );
797
+ if( !empty( $menu ) ){
798
+ $instance['menu'] = $menu->term_id;
799
+ }
800
+ }
801
+
802
  //sanitize $instance...
803
  $instance = self::cmw_settings( $instance, array(), __FUNCTION__ );
804
  //holds information determined by the walker...
1434
  'switch_to' => '', //v3.1.0 (a [cmwizard .../] shortcode)
1435
  'menu_class' => 'menu-widget',
1436
  'widget_class' => '',
1437
+ 'cmwv' => Custom_Menu_Wizard_Plugin::$version
1438
  ) as $k => $v ){
1439
 
1440
  $instance[ $k ] = isset( $from_instance[ $k ] ) ? strip_tags( trim( (string)$from_instance[ $k ] ) ) : $v;
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,navigation,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: 4.3.1
7
- Stable tag: 3.2.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.
@@ -876,6 +876,9 @@ because Version 2 will **not** be supported beyond Version 3.
876
 
877
  == Changelog ==
878
 
 
 
 
879
  = 3.2.1 =
880
  * bugfix : missing echo statement for the update message
881
 
@@ -1029,6 +1032,9 @@ because Version 2 will **not** be supported beyond Version 3.
1029
 
1030
  == Upgrade Notice ==
1031
 
 
 
 
1032
  = 3.2.1 =
1033
  Fixed a tiny bug with a missing echo statement.
1034
 
4
  Tags: menu,widget,navigation,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: 4.3.1
7
+ Stable tag: 3.2.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.
876
 
877
  == Changelog ==
878
 
879
+ = 3.2.2 =
880
+ * bugfix : fixed initial widget display when adding new widget instance in the customizer
881
+
882
  = 3.2.1 =
883
  * bugfix : missing echo statement for the update message
884
 
1032
 
1033
  == Upgrade Notice ==
1034
 
1035
+ = 3.2.2 =
1036
+ Fixed a bug on the very first rendering of a newly added widget via the customizer, where the widget output rendered in legacy mode until an option got changed or the widget was saved.
1037
+
1038
  = 3.2.1 =
1039
  Fixed a tiny bug with a missing echo statement.
1040