Max Mega Menu - Version 2.3.6

Version Description

[09/05/17] =

  • Fix: Mobile breakpoint detection
  • Fix: Increase wp_nav_menu_args priority to fix conflict with Thim-Core (Eduma theme)
  • Fix: Add tabindex to items where the link has been disabled
  • Fix: Deleting newly added mobile toggle blocks
  • Improvement: Add mega menu button to unsaved menu items
  • Improvement: Enable descriptions and disable css prefix of menu item classes by default (for new users only)
  • Improvement: Add mobile font color to theme options
  • Improvement: Improve error shown when failing to save theme
  • Improvement: Improve message shown when menu is not tagged to a location
  • Improvement: Attempt to raise memory limit when generating CSS
  • Improvement: Enable highlight current item by default
  • Improvement: Show warnings when CSS output is set to disabled
  • Improvement: Add image widget option to available widgets, even if not installed
  • Improvement: Update translations
  • Improvement: Add megamenu_submitted_settings_meta filter
Download this release

Release Info

Developer megamenu
Plugin Icon 128x128 Max Mega Menu
Version 2.3.6
Comparing to
See all releases

Code changes from version 2.3.5 to 2.3.6

classes/menu-item-manager.class.php CHANGED
@@ -388,7 +388,7 @@ class Mega_Menu_Menu_Item_Manager {
388
  }
389
 
390
  } else {
391
- $return .= "<p class='no_widgets'>" . __("No widgets found. Add a widget to this area using the Widget Selector (top right)") . "</p>";
392
  }
393
 
394
  $return .= "</div>";
388
  }
389
 
390
  } else {
391
+ $return .= "<p class='no_widgets'>" . __("No widgets found. Add a widget to this area using the Widget Selector (top right)", "megamenu") . "</p>";
392
  }
393
 
394
  $return .= "</div>";
classes/nav-menus.class.php CHANGED
@@ -188,11 +188,13 @@ class Mega_Menu_Nav_Menus {
188
  'get_started' => __("Use these settings to enable Max Mega Menu", "megamenu"),
189
  'launch_lightbox' => __("Mega Menu", "megamenu"),
190
  'is_disabled_error' => __("Please enable Max Mega Menu using the settings on the left of this page.", "megamenu"),
 
191
  'saving' => __("Saving", "megamenu"),
192
  'nonce' => wp_create_nonce('megamenu_edit'),
193
  'nonce_check_failed' => __("Oops. Something went wrong. Please reload the page.", "megamenu"),
194
  'css_prefix' => $prefix,
195
- 'css_prefix_message' => __("Custom CSS Classes will be prefixed with 'mega-'", "megamenu")
 
196
  )
197
  );
198
 
@@ -259,6 +261,8 @@ class Mega_Menu_Nav_Menus {
259
  }
260
  }
261
 
 
 
262
  if ( ! get_option( 'megamenu_settings' ) ) {
263
 
264
  update_option( 'megamenu_settings', $submitted_settings );
@@ -309,6 +313,8 @@ class Mega_Menu_Nav_Menus {
309
 
310
  echo "<p>" . __("Please assign this menu to a theme location to enable the Mega Menu settings.", "megamenu") . "</p>";
311
 
 
 
312
  } else { ?>
313
 
314
  <?php if ( count( $tagged_menu_locations ) == 1 ) : ?>
188
  'get_started' => __("Use these settings to enable Max Mega Menu", "megamenu"),
189
  'launch_lightbox' => __("Mega Menu", "megamenu"),
190
  'is_disabled_error' => __("Please enable Max Mega Menu using the settings on the left of this page.", "megamenu"),
191
+ 'save_menu' => __("Please save the menu structure to enable this option.", "megamenu"),
192
  'saving' => __("Saving", "megamenu"),
193
  'nonce' => wp_create_nonce('megamenu_edit'),
194
  'nonce_check_failed' => __("Oops. Something went wrong. Please reload the page.", "megamenu"),
195
  'css_prefix' => $prefix,
196
+ 'css_prefix_message' => __("Custom CSS Classes will be prefixed with 'mega-'", "megamenu"),
197
+ 'not_installed_image_widget' => __("Image Widget not installed. Please go to Plugins > Add New and search for 'Image Widget' to enable this option.", "megamenu")
198
  )
199
  );
200
 
261
  }
262
  }
263
 
264
+ $submitted_settings = apply_filters("megamenu_submitted_settings_meta", $submitted_settings);
265
+
266
  if ( ! get_option( 'megamenu_settings' ) ) {
267
 
268
  update_option( 'megamenu_settings', $submitted_settings );
313
 
314
  echo "<p>" . __("Please assign this menu to a theme location to enable the Mega Menu settings.", "megamenu") . "</p>";
315
 
316
+ echo "<p>" . __("To assign this menu to a theme location, scroll to the bottom of this page and tag the menu to a 'Display location'.", "megamenu") . "</p>";
317
+
318
  } else { ?>
319
 
320
  <?php if ( count( $tagged_menu_locations ) == 1 ) : ?>
classes/settings.class.php CHANGED
@@ -266,6 +266,9 @@ class Mega_Menu_Settings {
266
  // delete toggle blocks
267
  delete_option("megamenu_toggle_blocks");
268
 
 
 
 
269
  // delete all widgets assigned to menus
270
  $widget_manager = new Mega_Menu_Widget_Manager();
271
 
@@ -724,7 +727,10 @@ class Mega_Menu_Settings {
724
  <div class='mega-description'>
725
  <div class='fs' style='display: <?php echo $css == 'fs' ? 'block' : 'none' ?>'><?php _e("CSS will be saved to wp-content/uploads/maxmegamenu/style.css and enqueued from there.", "megamenu"); ?></div>
726
  <div class='head' style='display: <?php echo $css == 'head' ? 'block' : 'none' ?>'><?php _e("CSS will be loaded from the cache in a &lt;style&gt; tag in the &lt;head&gt; of the page.", "megamenu"); ?></div>
727
- <div class='disabled' style='display: <?php echo $css == 'disabled' ? 'block' : 'none' ?>'><?php _e("CSS will not be output, you must enqueue the CSS for the menu manually.", "megamenu"); ?></div>
 
 
 
728
  </div>
729
  </td>
730
  </tr>
@@ -856,7 +862,7 @@ class Mega_Menu_Settings {
856
  <tr>
857
  <td class='mega-name'>
858
  <?php _e("Registered Menu Locations", "megamenu"); ?>
859
- <div class='mega-description'><?php _e("This is an overview of the menu locations supported by your theme. You can enable Max Mega Menu and adjust the settings for a specific menu location by going to Appearance > Menus."); ?></div>
860
  </td>
861
  <td class='mega-value'>
862
  <p>
@@ -927,7 +933,7 @@ class Mega_Menu_Settings {
927
  <h5><?php _e("Menu Display Options", "megamenu"); ?></h5>
928
 
929
  <?php if ( ! $is_custom_location ) : ?>
930
- <p><?php _e("These options are for advanced users only. Your theme should already include the code required to display this menu on your site."); ?>
931
  <?php endif; ?>
932
 
933
  <table>
@@ -976,7 +982,7 @@ class Mega_Menu_Settings {
976
  echo '<div class="megamenu_submit"><div class="mega_left">';
977
  submit_button();
978
  echo '</div><div class="mega_right">';
979
- echo "<a class='confirm mega-delete' href='{$delete_location_url}'>" . __("Delete location") . "</a>";
980
  echo '</div></div>';
981
 
982
  }
@@ -1003,7 +1009,7 @@ class Mega_Menu_Settings {
1003
  wp_nonce_url( admin_url("admin-post.php"), 'megamenu_add_menu_location' )
1004
  ) );
1005
 
1006
- echo "<br /><p><a class='button button-secondary' href='{$add_location_url}'>" . __("Add another menu location") . "</a></p>";
1007
 
1008
  ?>
1009
 
@@ -1118,7 +1124,7 @@ class Mega_Menu_Settings {
1118
  }
1119
  if ( isset( $_POST['format'] ) && $_POST['format'] == 'json' ) {
1120
 
1121
- echo "<p>" . __("Log into the site you wish to import the theme to. Go to Mega Menu > Tools and paste this into the 'Import Theme' text area:") . "</p>";
1122
 
1123
  echo "<textarea>" . htmlentities( json_encode( $diff ) ) . "</textarea>";
1124
 
@@ -1127,7 +1133,7 @@ class Mega_Menu_Settings {
1127
 
1128
  $key .= "_" . time();
1129
 
1130
- echo "<p>" . __("Paste this code into your themes functions.php file:") . "</p>";
1131
 
1132
  echo '<textarea>';
1133
  echo 'function megamenu_add_theme_' . $key . '($themes) {';
@@ -1155,8 +1161,8 @@ class Mega_Menu_Settings {
1155
  echo "</select>";
1156
 
1157
  echo "<h4>" . __("Export Format", "megamenu") . "</h4>";
1158
- echo "<input value='json' type='radio' checked='checked' name='format'>" . __("JSON - I want to import this theme into another site I'm developing") . "<br />";
1159
- echo "<input value='php' type='radio' name='format'>" . __("PHP - I want to distribute this Menu Theme in a WordPress Theme I'm developing") . "<br />";
1160
 
1161
  echo "<input type='submit' name='export' class='button button-secondary' value='" . __("Export Theme", "megamenu") . "' />";
1162
 
@@ -1527,6 +1533,17 @@ class Mega_Menu_Settings {
1527
 
1528
  <h3 class='editing_theme'><?php echo __("Editing theme", "megamenu") . ": " . $this->active_theme['title']; ?></h3>
1529
 
 
 
 
 
 
 
 
 
 
 
 
1530
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="theme_editor">
1531
  <input type="hidden" name="theme_id" value="<?php echo $this->id; ?>" />
1532
  <input type="hidden" name="action" value="megamenu_save_theme" />
@@ -1542,10 +1559,10 @@ class Mega_Menu_Settings {
1542
  'title' => array(
1543
  'priority' => 10,
1544
  'title' => __( "Theme Title", "megamenu" ),
1545
- 'description' => __( "", "megamenu" ),
1546
  'settings' => array(
1547
  array(
1548
- 'title' => __( "", "megamenu" ),
1549
  'type' => 'freetext',
1550
  'key' => 'title'
1551
  )
@@ -1584,7 +1601,7 @@ class Mega_Menu_Settings {
1584
  'description' => __( "Set the general line height to use in the panel contents.", "megamenu" ),
1585
  'settings' => array(
1586
  array(
1587
- 'title' => __( "", "megamenu" ),
1588
  'type' => 'freetext',
1589
  'key' => 'line_height'
1590
  )
@@ -1596,7 +1613,7 @@ class Mega_Menu_Settings {
1596
  'description' => __( "Set the z-index to ensure the panels appear ontop of other content.", "megamenu" ),
1597
  'settings' => array(
1598
  array(
1599
- 'title' => __( "", "megamenu" ),
1600
  'type' => 'freetext',
1601
  'key' => 'z_index',
1602
  'validation' => 'int'
@@ -1679,7 +1696,7 @@ class Mega_Menu_Settings {
1679
  'description' => __( "Define the height of each top level menu item link. This value plus the Menu Padding (top and bottom) settings define the overall height of the menu bar.", "megamenu" ),
1680
  'settings' => array(
1681
  array(
1682
- 'title' => __( "", "megamenu" ),
1683
  'type' => 'freetext',
1684
  'key' => 'menu_item_link_height',
1685
  'validation' => 'px'
@@ -1777,7 +1794,7 @@ class Mega_Menu_Settings {
1777
  'info' => array( __( "This option will apply to all menu items. To align an individual menu item to the right, edit the menu item itself and set 'Menu Item Align' to 'Right'.", "megamenu" ) ),
1778
  'settings' => array(
1779
  array(
1780
- 'title' => __( "", "megamenu" ),
1781
  'type' => 'align',
1782
  'key' => 'menu_item_align'
1783
  )
@@ -1838,7 +1855,7 @@ class Mega_Menu_Settings {
1838
  'description' => __( "Define the size of the gap between each top level menu item.", "megamenu" ),
1839
  'settings' => array(
1840
  array(
1841
- 'title' => __( "", "megamenu" ),
1842
  'type' => 'freetext',
1843
  'key' => 'menu_item_spacing',
1844
  'validation' => 'px'
@@ -2733,7 +2750,7 @@ class Mega_Menu_Settings {
2733
  'info' => array( __( "Set this value to the width of your longest menu item title to stop menu items wrapping onto 2 lines.", "megamenu" ) ),
2734
  'settings' => array(
2735
  array(
2736
- 'title' => __( "", "megamenu" ),
2737
  'type' => 'freetext',
2738
  'key' => 'flyout_width',
2739
  'validation' => 'px'
@@ -2889,7 +2906,7 @@ class Mega_Menu_Settings {
2889
  'description' => __( "The height of each flyout menu item.", "megamenu" ),
2890
  'settings' => array(
2891
  array(
2892
- 'title' => __( "", "megamenu" ),
2893
  'type' => 'freetext',
2894
  'key' => 'flyout_link_height',
2895
  'validation' => 'px'
@@ -3009,28 +3026,6 @@ class Mega_Menu_Settings {
3009
  'mobile_menu' => array(
3010
  'title' => __( "Mobile Menu", "megamenu" ),
3011
  'settings' => array(
3012
- /**'responsive_text' => array(
3013
- 'title' => __( "Toggle Bar Text", "megamenu" ),
3014
- 'description' => __( "Text to display next to the mobile toggle icon.", "megamenu" ),
3015
- 'settings' => array(
3016
- array(
3017
- 'title' => __( "", "megamenu" ),
3018
- 'type' => 'freetext',
3019
- 'key' => 'responsive_text'
3020
- )
3021
- )
3022
- ),**/
3023
- /**'toggle_font' => array(
3024
- 'title' => __( "Toggle Bar Text Color", "megamenu" ),
3025
- 'description' => __( "Set the font color for the toggle bar.", "megamenu" ),
3026
- 'settings' => array(
3027
- array(
3028
- 'title' => __( "", "megamenu" ),
3029
- 'type' => 'color',
3030
- 'key' => 'toggle_font_color'
3031
- )
3032
- )
3033
- ),**/
3034
  'toggle_bar_background' => array(
3035
  'priority' => 20,
3036
  'title' => __( "Toggle Bar Background", "megamenu" ),
@@ -3059,7 +3054,7 @@ class Mega_Menu_Settings {
3059
  'description' => __( "Set the height of the mobile menu toggle bar.", "megamenu" ),
3060
  'settings' => array(
3061
  array(
3062
- 'title' => __( "", "megamenu" ),
3063
  'type' => 'freetext',
3064
  'key' => 'toggle_bar_height'
3065
  )
@@ -3071,7 +3066,7 @@ class Mega_Menu_Settings {
3071
  'description' => __( "Hide the toggle bar and display the menu in it's open state by default.", "megamenu" ),
3072
  'settings' => array(
3073
  array(
3074
- 'title' => __( "", "megamenu" ),
3075
  'type' => 'checkbox',
3076
  'key' => 'disable_mobile_toggle'
3077
  )
@@ -3083,7 +3078,7 @@ class Mega_Menu_Settings {
3083
  'description' => __( "Set the width at which the menu turns into a mobile menu. Set to 0px to disable responsive menu.", "megamenu" ),
3084
  'settings' => array(
3085
  array(
3086
- 'title' => __( "", "megamenu" ),
3087
  'type' => 'freetext',
3088
  'key' => 'responsive_breakpoint',
3089
  'validation' => 'px'
@@ -3096,7 +3091,7 @@ class Mega_Menu_Settings {
3096
  'description' => __( "Number of columns to display widgets/second level menu items in.", "megamenu" ),
3097
  'settings' => array(
3098
  array(
3099
- 'title' => __( "", "megamenu" ),
3100
  'type' => 'mobile_columns',
3101
  'key' => 'mobile_columns'
3102
  )
@@ -3130,12 +3125,35 @@ class Mega_Menu_Settings {
3130
  'description' => __( "Height of each top level item in the mobile menu.", "megamenu" ),
3131
  'settings' => array(
3132
  array(
3133
- 'title' => __( "", "megamenu" ),
3134
  'type' => 'freetext',
3135
  'key' => 'mobile_menu_item_height'
3136
  )
3137
  )
3138
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3139
  )
3140
  ),
3141
  'custom_styling' => array(
@@ -3147,7 +3165,7 @@ class Mega_Menu_Settings {
3147
  'description' => __( "Define any custom CSS you wish to add to menus using this theme. You can use standard CSS or SCSS.", "megamenu"),
3148
  'settings' => array(
3149
  array(
3150
- 'title' => __( "", "megamenu" ),
3151
  'type' => 'textarea',
3152
  'key' => 'custom_css'
3153
  )
@@ -3718,7 +3736,7 @@ class Mega_Menu_Settings {
3718
  wp_localize_script( 'mega-menu-theme-editor', 'megamenu_settings',
3719
  array(
3720
  'confirm' => __("Are you sure?", "megamenu"),
3721
- "theme_save_error" => __("Error saving theme, please try refreshing the page", "megamenu")
3722
  )
3723
  );
3724
 
266
  // delete toggle blocks
267
  delete_option("megamenu_toggle_blocks");
268
 
269
+ // delete version
270
+ delete_option("megamenu_version");
271
+
272
  // delete all widgets assigned to menus
273
  $widget_manager = new Mega_Menu_Widget_Manager();
274
 
727
  <div class='mega-description'>
728
  <div class='fs' style='display: <?php echo $css == 'fs' ? 'block' : 'none' ?>'><?php _e("CSS will be saved to wp-content/uploads/maxmegamenu/style.css and enqueued from there.", "megamenu"); ?></div>
729
  <div class='head' style='display: <?php echo $css == 'head' ? 'block' : 'none' ?>'><?php _e("CSS will be loaded from the cache in a &lt;style&gt; tag in the &lt;head&gt; of the page.", "megamenu"); ?></div>
730
+ <div class='disabled' style='display: <?php echo $css == 'disabled' ? 'block' : 'none' ?>'>
731
+ <?php _e("CSS will not be output, you must enqueue the CSS for the menu manually.", "megamenu"); ?>
732
+ <div class='fail'><?php _e("Selecting this option will effectively disable the theme editor and many of the features available in Max Mega Menu and Max Mega Menu Pro. Only enable this option if you fully understand the consequences.", "megamenu"); ?>
733
+ </div>
734
  </div>
735
  </td>
736
  </tr>
862
  <tr>
863
  <td class='mega-name'>
864
  <?php _e("Registered Menu Locations", "megamenu"); ?>
865
+ <div class='mega-description'><?php _e("This is an overview of the menu locations supported by your theme. You can enable Max Mega Menu and adjust the settings for a specific menu location by going to Appearance > Menus.", "megamenu"); ?></div>
866
  </td>
867
  <td class='mega-value'>
868
  <p>
933
  <h5><?php _e("Menu Display Options", "megamenu"); ?></h5>
934
 
935
  <?php if ( ! $is_custom_location ) : ?>
936
+ <p><?php _e("These options are for advanced users only. Your theme should already include the code required to display this menu on your site.", "megamenu"); ?>
937
  <?php endif; ?>
938
 
939
  <table>
982
  echo '<div class="megamenu_submit"><div class="mega_left">';
983
  submit_button();
984
  echo '</div><div class="mega_right">';
985
+ echo "<a class='confirm mega-delete' href='{$delete_location_url}'>" . __("Delete location", "megamenu") . "</a>";
986
  echo '</div></div>';
987
 
988
  }
1009
  wp_nonce_url( admin_url("admin-post.php"), 'megamenu_add_menu_location' )
1010
  ) );
1011
 
1012
+ echo "<br /><p><a class='button button-secondary' href='{$add_location_url}'>" . __("Add another menu location", "megamenu") . "</a></p>";
1013
 
1014
  ?>
1015
 
1124
  }
1125
  if ( isset( $_POST['format'] ) && $_POST['format'] == 'json' ) {
1126
 
1127
+ echo "<p>" . __("Log into the site you wish to import the theme to. Go to Mega Menu > Tools and paste this into the 'Import Theme' text area:", "megamenu") . "</p>";
1128
 
1129
  echo "<textarea>" . htmlentities( json_encode( $diff ) ) . "</textarea>";
1130
 
1133
 
1134
  $key .= "_" . time();
1135
 
1136
+ echo "<p>" . __("Paste this code into your themes functions.php file:", "megamenu") . "</p>";
1137
 
1138
  echo '<textarea>';
1139
  echo 'function megamenu_add_theme_' . $key . '($themes) {';
1161
  echo "</select>";
1162
 
1163
  echo "<h4>" . __("Export Format", "megamenu") . "</h4>";
1164
+ echo "<input value='json' type='radio' checked='checked' name='format'>" . __("JSON - I want to import this theme into another site I'm developing", "megamenu") . "<br />";
1165
+ echo "<input value='php' type='radio' name='format'>" . __("PHP - I want to distribute this Menu Theme in a WordPress Theme I'm developing", "megamenu") . "<br />";
1166
 
1167
  echo "<input type='submit' name='export' class='button button-secondary' value='" . __("Export Theme", "megamenu") . "' />";
1168
 
1533
 
1534
  <h3 class='editing_theme'><?php echo __("Editing theme", "megamenu") . ": " . $this->active_theme['title']; ?></h3>
1535
 
1536
+ <?php
1537
+
1538
+ $saved_settings = get_option("megamenu_settings");
1539
+
1540
+ if (isset($saved_settings['css']) && $saved_settings['css'] == 'disabled') {
1541
+ ?>
1542
+ <div class='fail'><?php _e("CSS Output (under Mega Menu > General Settings) has been disabled. Therefore, changes made within the theme editor will not be applied to your menu.", "megamenu"); ?></div>
1543
+ <?php
1544
+ }
1545
+ ?>
1546
+
1547
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="theme_editor">
1548
  <input type="hidden" name="theme_id" value="<?php echo $this->id; ?>" />
1549
  <input type="hidden" name="action" value="megamenu_save_theme" />
1559
  'title' => array(
1560
  'priority' => 10,
1561
  'title' => __( "Theme Title", "megamenu" ),
1562
+ 'description' => "",
1563
  'settings' => array(
1564
  array(
1565
+ 'title' => "",
1566
  'type' => 'freetext',
1567
  'key' => 'title'
1568
  )
1601
  'description' => __( "Set the general line height to use in the panel contents.", "megamenu" ),
1602
  'settings' => array(
1603
  array(
1604
+ 'title' => "",
1605
  'type' => 'freetext',
1606
  'key' => 'line_height'
1607
  )
1613
  'description' => __( "Set the z-index to ensure the panels appear ontop of other content.", "megamenu" ),
1614
  'settings' => array(
1615
  array(
1616
+ 'title' => "",
1617
  'type' => 'freetext',
1618
  'key' => 'z_index',
1619
  'validation' => 'int'
1696
  'description' => __( "Define the height of each top level menu item link. This value plus the Menu Padding (top and bottom) settings define the overall height of the menu bar.", "megamenu" ),
1697
  'settings' => array(
1698
  array(
1699
+ 'title' => "",
1700
  'type' => 'freetext',
1701
  'key' => 'menu_item_link_height',
1702
  'validation' => 'px'
1794
  'info' => array( __( "This option will apply to all menu items. To align an individual menu item to the right, edit the menu item itself and set 'Menu Item Align' to 'Right'.", "megamenu" ) ),
1795
  'settings' => array(
1796
  array(
1797
+ 'title' => "",
1798
  'type' => 'align',
1799
  'key' => 'menu_item_align'
1800
  )
1855
  'description' => __( "Define the size of the gap between each top level menu item.", "megamenu" ),
1856
  'settings' => array(
1857
  array(
1858
+ 'title' => "",
1859
  'type' => 'freetext',
1860
  'key' => 'menu_item_spacing',
1861
  'validation' => 'px'
2750
  'info' => array( __( "Set this value to the width of your longest menu item title to stop menu items wrapping onto 2 lines.", "megamenu" ) ),
2751
  'settings' => array(
2752
  array(
2753
+ 'title' => "",
2754
  'type' => 'freetext',
2755
  'key' => 'flyout_width',
2756
  'validation' => 'px'
2906
  'description' => __( "The height of each flyout menu item.", "megamenu" ),
2907
  'settings' => array(
2908
  array(
2909
+ 'title' => "",
2910
  'type' => 'freetext',
2911
  'key' => 'flyout_link_height',
2912
  'validation' => 'px'
3026
  'mobile_menu' => array(
3027
  'title' => __( "Mobile Menu", "megamenu" ),
3028
  'settings' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3029
  'toggle_bar_background' => array(
3030
  'priority' => 20,
3031
  'title' => __( "Toggle Bar Background", "megamenu" ),
3054
  'description' => __( "Set the height of the mobile menu toggle bar.", "megamenu" ),
3055
  'settings' => array(
3056
  array(
3057
+ 'title' => "",
3058
  'type' => 'freetext',
3059
  'key' => 'toggle_bar_height'
3060
  )
3066
  'description' => __( "Hide the toggle bar and display the menu in it's open state by default.", "megamenu" ),
3067
  'settings' => array(
3068
  array(
3069
+ 'title' => "",
3070
  'type' => 'checkbox',
3071
  'key' => 'disable_mobile_toggle'
3072
  )
3078
  'description' => __( "Set the width at which the menu turns into a mobile menu. Set to 0px to disable responsive menu.", "megamenu" ),
3079
  'settings' => array(
3080
  array(
3081
+ 'title' => "",
3082
  'type' => 'freetext',
3083
  'key' => 'responsive_breakpoint',
3084
  'validation' => 'px'
3091
  'description' => __( "Number of columns to display widgets/second level menu items in.", "megamenu" ),
3092
  'settings' => array(
3093
  array(
3094
+ 'title' => "",
3095
  'type' => 'mobile_columns',
3096
  'key' => 'mobile_columns'
3097
  )
3125
  'description' => __( "Height of each top level item in the mobile menu.", "megamenu" ),
3126
  'settings' => array(
3127
  array(
3128
+ 'title' => "",
3129
  'type' => 'freetext',
3130
  'key' => 'mobile_menu_item_height'
3131
  )
3132
  )
3133
+ ),
3134
+ 'mobile_menu_item_font' => array(
3135
+ 'priority' => 50,
3136
+ 'title' => __( "Font", "megamenu" ),
3137
+ 'description' => __( "The font to use for each top level menu item in the mobile menu.", "megamenu" ),
3138
+ 'settings' => array(
3139
+ array(
3140
+ 'title' => __( "Color", "megamenu" ),
3141
+ 'type' => 'color',
3142
+ 'key' => 'mobile_menu_item_link_color'
3143
+ ),
3144
+ array(
3145
+ 'title' => __( "Size", "megamenu" ),
3146
+ 'type' => 'freetext',
3147
+ 'key' => 'mobile_menu_item_link_font_size',
3148
+ 'validation' => 'px'
3149
+ ),
3150
+ array(
3151
+ 'title' => __( "Align", "megamenu" ),
3152
+ 'type' => 'align',
3153
+ 'key' => 'mobile_menu_item_link_text_align'
3154
+ ),
3155
+ )
3156
+ ),
3157
  )
3158
  ),
3159
  'custom_styling' => array(
3165
  'description' => __( "Define any custom CSS you wish to add to menus using this theme. You can use standard CSS or SCSS.", "megamenu"),
3166
  'settings' => array(
3167
  array(
3168
+ 'title' => "",
3169
  'type' => 'textarea',
3170
  'key' => 'custom_css'
3171
  )
3736
  wp_localize_script( 'mega-menu-theme-editor', 'megamenu_settings',
3737
  array(
3738
  'confirm' => __("Are you sure?", "megamenu"),
3739
+ "theme_save_error" => __("Error saving theme, please try refreshing the page. Server response:", "megamenu")
3740
  )
3741
  );
3742
 
classes/style-manager.class.php CHANGED
@@ -106,7 +106,7 @@ final class Mega_Menu_Style_Manager {
106
  'menu_item_border_top' => '0px',
107
  'menu_item_border_bottom' => '0px',
108
  'menu_item_border_color_hover' => '#fff',
109
- 'menu_item_highlight_current' => 'off',
110
  'menu_item_divider' => 'off',
111
  'menu_item_divider_color' => 'rgba(255, 255, 255, 0.1)',
112
  'menu_item_divider_glow_opacity' => '0.1',
@@ -248,12 +248,14 @@ final class Mega_Menu_Style_Manager {
248
  'mobile_menu_item_height' => '40px',
249
  'mobile_background_from' => 'container_background_from',
250
  'mobile_background_to' => 'container_background_to',
 
 
 
251
  'disable_mobile_toggle' => 'off',
252
- 'custom_css' => '
253
- /** Push menu onto new line **/
254
- #{$wrap} {
255
- clear: both;
256
- }'
257
  ) );
258
  }
259
 
@@ -421,6 +423,10 @@ final class Mega_Menu_Style_Manager {
421
  */
422
  public function generate_css() {
423
 
 
 
 
 
424
  // the settings may have changed since the class was instantiated,
425
  // reset them here
426
  $this->settings = get_option( "megamenu_settings" );
@@ -481,6 +487,7 @@ final class Mega_Menu_Style_Manager {
481
 
482
  $upload_dir = wp_upload_dir();
483
  $filename = $this->get_css_filename();
 
484
  $dir = trailingslashit( $upload_dir['basedir'] ) . 'maxmegamenu/';
485
 
486
  WP_Filesystem( false, $upload_dir['basedir'], true );
@@ -968,6 +975,7 @@ final class Mega_Menu_Style_Manager {
968
  public function head_css() {
969
 
970
  if ( in_array( $this->get_css_output_method(), array( 'disabled', 'fs' ) ) ) {
 
971
  return;
972
  }
973
 
106
  'menu_item_border_top' => '0px',
107
  'menu_item_border_bottom' => '0px',
108
  'menu_item_border_color_hover' => '#fff',
109
+ 'menu_item_highlight_current' => 'on',
110
  'menu_item_divider' => 'off',
111
  'menu_item_divider_color' => 'rgba(255, 255, 255, 0.1)',
112
  'menu_item_divider_glow_opacity' => '0.1',
248
  'mobile_menu_item_height' => '40px',
249
  'mobile_background_from' => 'container_background_from',
250
  'mobile_background_to' => 'container_background_to',
251
+ 'mobile_menu_item_link_font_size' => 'menu_item_link_font_size',
252
+ 'mobile_menu_item_link_color' => 'menu_item_link_color',
253
+ 'mobile_menu_item_link_text_align' => 'menu_item_link_text_align',
254
  'disable_mobile_toggle' => 'off',
255
+ 'custom_css' => '/** Push menu onto new line **/
256
+ #{$wrap} {
257
+ clear: both;
258
+ }'
 
259
  ) );
260
  }
261
 
423
  */
424
  public function generate_css() {
425
 
426
+ if ( function_exists('wp_raise_memory_limit') ) {
427
+ wp_raise_memory_limit(); // attempt to raise memory limit to 256MB
428
+ }
429
+
430
  // the settings may have changed since the class was instantiated,
431
  // reset them here
432
  $this->settings = get_option( "megamenu_settings" );
487
 
488
  $upload_dir = wp_upload_dir();
489
  $filename = $this->get_css_filename();
490
+
491
  $dir = trailingslashit( $upload_dir['basedir'] ) . 'maxmegamenu/';
492
 
493
  WP_Filesystem( false, $upload_dir['basedir'], true );
975
  public function head_css() {
976
 
977
  if ( in_array( $this->get_css_output_method(), array( 'disabled', 'fs' ) ) ) {
978
+ echo "<style type=\"text/css\">/** Mega Menu CSS Disabled **/</style>\n";
979
  return;
980
  }
981
 
classes/toggle-blocks.class.php CHANGED
@@ -222,7 +222,7 @@ class Mega_Menu_Toggle_Blocks {
222
  'description' => __( "Configure the contents of the mobile toggle bar", "megamenu" ),
223
  'settings' => array(
224
  array(
225
- 'title' => __( "", "megamenu" ),
226
  'type' => 'toggle_blocks',
227
  'key' => 'toggle_blocks'
228
  )
222
  'description' => __( "Configure the contents of the mobile toggle bar", "megamenu" ),
223
  'settings' => array(
224
  array(
225
+ 'title' => "",
226
  'type' => 'toggle_blocks',
227
  'key' => 'toggle_blocks'
228
  )
classes/walker.class.php CHANGED
@@ -102,6 +102,8 @@ class Mega_Menu_Walker extends Walker_Nav_Menu {
102
 
103
  if ( $settings['disable_link'] != 'true') {
104
  $atts['href'] = ! empty( $item->url ) ? $item->url : '';
 
 
105
  }
106
 
107
  if ( isset( $settings['icon']) && $settings['icon'] != 'disabled' ) {
102
 
103
  if ( $settings['disable_link'] != 'true') {
104
  $atts['href'] = ! empty( $item->url ) ? $item->url : '';
105
+ } else {
106
+ $atts['tabindex'] = 0;
107
  }
108
 
109
  if ( isset( $settings['icon']) && $settings['icon'] != 'disabled' ) {
classes/widget-manager.class.php CHANGED
@@ -271,6 +271,13 @@ class Mega_Menu_Widget_Manager {
271
 
272
  }
273
 
 
 
 
 
 
 
 
274
  uasort( $widgets, array( $this, 'sort_by_text' ) );
275
 
276
  return $widgets;
271
 
272
  }
273
 
274
+ if ( ! is_plugin_active('image-widget-deluxe/image-widget-deluxe.php') && ! is_plugin_active('image-widget/image-widget.php') ) {
275
+ $widgets[] = array(
276
+ 'text' => __("Image Widget", "megamenu"),
277
+ 'value' => "not_installed_image_widget"
278
+ );
279
+ }
280
+
281
  uasort( $widgets, array( $this, 'sort_by_text' ) );
282
 
283
  return $widgets;
css/admin/menus.css CHANGED
@@ -800,6 +800,10 @@
800
  background: #2ea2cc;
801
  border-color: #0074a2;
802
  }
 
 
 
 
803
  .megamenu_enabled .mm_prefix {
804
  display: block;
805
  font-size: 0.9em;
800
  background: #2ea2cc;
801
  border-color: #0074a2;
802
  }
803
+ .megamenu_enabled .mm_launch.mm_disabled {
804
+ background: #999;
805
+ border-color: #333;
806
+ }
807
  .megamenu_enabled .mm_prefix {
808
  display: block;
809
  font-size: 0.9em;
css/admin/settings.css CHANGED
@@ -584,6 +584,12 @@ body[class*='mega-menu_page_maxmegamenu_'] .menu_settings h3 {
584
  width: 100%;
585
  box-sizing: border-box;
586
  }
 
 
 
 
 
 
587
  .megamenu_outer_wrap .megamenu_wrap .megamenu_submit .success {
588
  border: 1px solid #7ad03a;
589
  background: #7ad03a;
584
  width: 100%;
585
  box-sizing: border-box;
586
  }
587
+
588
+ .megamenu_outer_wrap .megamenu_right .mega-description .fail {
589
+ margin-top: 20px;
590
+ color: #666;
591
+ }
592
+
593
  .megamenu_outer_wrap .megamenu_wrap .megamenu_submit .success {
594
  border: 1px solid #7ad03a;
595
  background: #7ad03a;
css/megamenu.scss CHANGED
@@ -379,6 +379,12 @@
379
  @include border-radius($menu_item_link_border_radius_top_left, $menu_item_link_border_radius_top_right, $menu_item_link_border_radius_bottom_right, $menu_item_link_border_radius_bottom_left);
380
  font-family: $menu_item_link_font;
381
  font-size: $menu_item_link_font_size;
 
 
 
 
 
 
382
  }
383
 
384
  // support for multi line links
379
  @include border-radius($menu_item_link_border_radius_top_left, $menu_item_link_border_radius_top_right, $menu_item_link_border_radius_bottom_right, $menu_item_link_border_radius_bottom_left);
380
  font-family: $menu_item_link_font;
381
  font-size: $menu_item_link_font_size;
382
+
383
+ @include mobile {
384
+ text-align: $mobile_menu_item_link_text_align;
385
+ color: $mobile_menu_item_link_color;
386
+ font-size: $mobile_menu_item_link_font_size;
387
+ }
388
  }
389
 
390
  // support for multi line links
js/admin.js CHANGED
@@ -216,6 +216,12 @@
216
 
217
  var selector = $(this);
218
 
 
 
 
 
 
 
219
  if (selector.val() != 'disabled') {
220
 
221
  start_saving();
@@ -553,6 +559,8 @@ jQuery(function ($) {
553
  var menu_id = $('input#menu').val();
554
  var title = menu_item.find('.menu-item-title').text();
555
 
 
 
556
  // fix for Jupiter theme
557
  if ( ! title ) {
558
  title = menu_item.find('.item-title').text();
@@ -590,6 +598,24 @@ jQuery(function ($) {
590
 
591
  });
592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
 
594
  // AJAX Save MMM Settings
595
  $(".max-mega-menu-save").on('click', function(e) {
216
 
217
  var selector = $(this);
218
 
219
+ if (selector.val() == 'not_installed_image_widget') {
220
+ alert(megamenu.not_installed_image_widget);
221
+ selector.val('disabled');
222
+ return;
223
+ }
224
+
225
  if (selector.val() != 'disabled') {
226
 
227
  start_saving();
559
  var menu_id = $('input#menu').val();
560
  var title = menu_item.find('.menu-item-title').text();
561
 
562
+ menu_item.data('megamenu_has_button', 'true');
563
+
564
  // fix for Jupiter theme
565
  if ( ! title ) {
566
  title = menu_item.find('.item-title').text();
598
 
599
  });
600
 
601
+ $('.megamenu_enabled #menu-to-edit li.menu-item').live('hover', function() {
602
+ var menu_item = $(this);
603
+
604
+ if (!menu_item.data('megamenu_has_button')) {
605
+
606
+ menu_item.data('megamenu_has_button', 'true');
607
+
608
+ var button = $("<span>").addClass("mm_launch mm_disabled")
609
+ .html(megamenu.launch_lightbox)
610
+ .on('click', function(e) {
611
+ e.preventDefault();
612
+ alert(megamenu.save_menu);
613
+ });
614
+
615
+ $('.item-title', menu_item).append(button);
616
+ }
617
+ });
618
+
619
 
620
  // AJAX Save MMM Settings
621
  $(".max-mega-menu-save").on('click', function(e) {
js/maxmegamenu.js CHANGED
@@ -77,7 +77,7 @@
77
  };
78
 
79
  plugin.isDesktopView = function() {
80
- return Math.max(window.outerWidth, $(window).width()) >= plugin.settings.breakpoint; // account for scrollbars
81
  };
82
 
83
  plugin.isMobileView = function() {
77
  };
78
 
79
  plugin.isDesktopView = function() {
80
+ return Math.max(window.outerWidth, $(window).width()) > plugin.settings.breakpoint; // account for scrollbars
81
  };
82
 
83
  plugin.isMobileView = function() {
js/settings.js CHANGED
@@ -119,8 +119,9 @@ jQuery(function ($) {
119
  $('.megamenu_submit .mega_left').append(success.html(icon).append(message.data));
120
  }
121
 
122
- }).fail(function() {
123
- alert( megamenu.theme_save_error );
 
124
  });
125
  }).on("change", function(e) {
126
  $(".theme_result_message").css('visibility', 'hidden');
119
  $('.megamenu_submit .mega_left').append(success.html(icon).append(message.data));
120
  }
121
 
122
+ }).fail(function(message) {
123
+ var error = $("<p>").addClass('fail theme_result_message').html(megamenu_settings.theme_save_error + "<br /><br />" + message.responseText );
124
+ $('.megamenu_submit').after(error);
125
  });
126
  }).on("change", function(e) {
127
  $(".theme_result_message").css('visibility', 'hidden');
js/toggledesigner.js CHANGED
@@ -66,7 +66,7 @@ jQuery(function($) {
66
 
67
 
68
  // Delete block
69
- $( ".block-settings").on('click', 'a.mega-delete', function(e) {
70
  e.preventDefault();
71
  $(this).parent(".block-settings").parent(".block").remove();
72
  reindex_blocks();
66
 
67
 
68
  // Delete block
69
+ $( ".mega-toggle_blocks").on('click', 'a.mega-delete', function(e) {
70
  e.preventDefault();
71
  $(this).parent(".block-settings").parent(".block").remove();
72
  reindex_blocks();
megamenu.php CHANGED
@@ -4,11 +4,11 @@
4
  * Plugin Name: Max Mega Menu
5
  * Plugin URI: https://www.megamenu.com
6
  * Description: Easy to use drag & drop WordPress Mega Menu plugin. Create Mega Menus using Widgets. Responsive, retina & touch ready.
7
- * Version: 2.3.5
8
  * Author: Tom Hemsley
9
  * Author URI: https://www.megamenu.com
10
  * License: GPL-2.0+
11
- * Copyright: 2016 Tom Hemsley (https://www.megamenu.com)
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
@@ -26,7 +26,7 @@ final class Mega_Menu {
26
  /**
27
  * @var string
28
  */
29
- public $version = '2.3.5';
30
 
31
 
32
  /**
@@ -61,7 +61,7 @@ final class Mega_Menu {
61
  add_action( 'widgets_init', array( $this, 'register_widget' ) );
62
  add_action( 'after_setup_theme', array( $this, 'register_nav_menus' ) );
63
 
64
- add_filter( 'wp_nav_menu_args', array( $this, 'modify_nav_menu_args' ), 9999 );
65
  add_filter( 'wp_nav_menu', array( $this, 'add_responsive_toggle' ), 10, 2 );
66
  add_filter( 'wp_nav_menu_objects', array( $this, 'add_widgets_to_menu' ), 10, 2 );
67
  add_filter( 'megamenu_nav_menu_objects_before', array( $this, 'setup_menu_items' ), 5, 2 );
@@ -209,6 +209,16 @@ final class Mega_Menu {
209
 
210
  do_action( "megamenu_after_install" );
211
 
 
 
 
 
 
 
 
 
 
 
212
  }
213
 
214
  }
4
  * Plugin Name: Max Mega Menu
5
  * Plugin URI: https://www.megamenu.com
6
  * Description: Easy to use drag & drop WordPress Mega Menu plugin. Create Mega Menus using Widgets. Responsive, retina & touch ready.
7
+ * Version: 2.3.6
8
  * Author: Tom Hemsley
9
  * Author URI: https://www.megamenu.com
10
  * License: GPL-2.0+
11
+ * Copyright: 2017 Tom Hemsley (https://www.megamenu.com)
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
26
  /**
27
  * @var string
28
  */
29
+ public $version = '2.3.6';
30
 
31
 
32
  /**
61
  add_action( 'widgets_init', array( $this, 'register_widget' ) );
62
  add_action( 'after_setup_theme', array( $this, 'register_nav_menus' ) );
63
 
64
+ add_filter( 'wp_nav_menu_args', array( $this, 'modify_nav_menu_args' ), 99999 );
65
  add_filter( 'wp_nav_menu', array( $this, 'add_responsive_toggle' ), 10, 2 );
66
  add_filter( 'wp_nav_menu_objects', array( $this, 'add_widgets_to_menu' ), 10, 2 );
67
  add_filter( 'megamenu_nav_menu_objects_before', array( $this, 'setup_menu_items' ), 5, 2 );
209
 
210
  do_action( "megamenu_after_install" );
211
 
212
+ $settings = get_option( "megamenu_settings" );
213
+
214
+ // set defaults
215
+ if ( ! $settings ) {
216
+ $settings['prefix'] = 'disabled';
217
+ $settings['descriptions'] = 'enabled';
218
+
219
+ add_option( "megamenu_settings", $settings);
220
+ }
221
+
222
  }
223
 
224
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: megamenu
3
  Tags: menu, megamenu, mega menu, navigation, widget, dropdown menu, drag and drop, mobile, responsive, retina, theme editor, widget, shortcode, sidebar, icons, dashicons
4
  Requires at least: 3.8
5
  Tested up to: 4.7
6
- Stable tag: 2.3.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -48,8 +48,7 @@ Max Mega Menu is developed with a focus on code quality, performance and usabili
48
  ####Pro Features:
49
 
50
  > * Sticky Menu
51
- > * Vertical Menus
52
- > * Accordion Menus
53
  > * FontAwesome, Genericon & Custom Icons
54
  > * Custom Item Styling
55
  > * Menu Logo
@@ -57,18 +56,12 @@ Max Mega Menu is developed with a focus on code quality, performance and usabili
57
  > * WooCommerce & EDD support
58
  > * Google Fonts
59
  > * Roles & Restrictions
60
- > * Search, icon and logo mobile toggle blocks
61
  > * Automatic updates
62
  > * Priority Support
63
  >
64
  > Find out more: https://www.megamenu.com/upgrade/
65
 
66
- Translations:
67
-
68
- * Italian (thanks to aeco)
69
- * German (thanks to Thomas Meyer & dirk@d10n)
70
- * French (thanks to Pierre_02)
71
-
72
  == Frequently Asked Questions ==
73
 
74
  Troubleshooting:
@@ -103,6 +96,24 @@ See https://www.megamenu.com for more screenshots
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  = 2.3.5 [19/02/17] =
107
 
108
  * Fix: Image Widget Deluxe extra options not displaying
3
  Tags: menu, megamenu, mega menu, navigation, widget, dropdown menu, drag and drop, mobile, responsive, retina, theme editor, widget, shortcode, sidebar, icons, dashicons
4
  Requires at least: 3.8
5
  Tested up to: 4.7
6
+ Stable tag: 2.3.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
48
  ####Pro Features:
49
 
50
  > * Sticky Menu
51
+ > * Vertical & Accordion Menus
 
52
  > * FontAwesome, Genericon & Custom Icons
53
  > * Custom Item Styling
54
  > * Menu Logo
56
  > * WooCommerce & EDD support
57
  > * Google Fonts
58
  > * Roles & Restrictions
59
+ > * Search, icon, HTML and logo mobile toggle blocks
60
  > * Automatic updates
61
  > * Priority Support
62
  >
63
  > Find out more: https://www.megamenu.com/upgrade/
64
 
 
 
 
 
 
 
65
  == Frequently Asked Questions ==
66
 
67
  Troubleshooting:
96
 
97
  == Changelog ==
98
 
99
+ = 2.3.6 [09/05/17] =
100
+
101
+ * Fix: Mobile breakpoint detection
102
+ * Fix: Increase wp_nav_menu_args priority to fix conflict with Thim-Core (Eduma theme)
103
+ * Fix: Add tabindex to items where the link has been disabled
104
+ * Fix: Deleting newly added mobile toggle blocks
105
+ * Improvement: Add mega menu button to unsaved menu items
106
+ * Improvement: Enable descriptions and disable css prefix of menu item classes by default (for new users only)
107
+ * Improvement: Add mobile font color to theme options
108
+ * Improvement: Improve error shown when failing to save theme
109
+ * Improvement: Improve message shown when menu is not tagged to a location
110
+ * Improvement: Attempt to raise memory limit when generating CSS
111
+ * Improvement: Enable highlight current item by default
112
+ * Improvement: Show warnings when CSS output is set to disabled
113
+ * Improvement: Add image widget option to available widgets, even if not installed
114
+ * Improvement: Update translations
115
+ * Improvement: Add megamenu_submitted_settings_meta filter
116
+
117
  = 2.3.5 [19/02/17] =
118
 
119
  * Fix: Image Widget Deluxe extra options not displaying