Max Mega Menu - Version 2.3.4

Version Description

[15/01/16] =

  • New: Automatic integration for GeneratePress and Twenty Twelve (hide duplicate mobile button)
  • New: "Icon Position" option added in the menu item settings (left, top, right) (requires clearing the Mega Menu CSS under Mega Menu > Tools)
  • Fix: JavaScript fix for tabbed mobile menus
Download this release

Release Info

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

Code changes from version 2.3.3 to 2.3.4

classes/menu-item-manager.class.php CHANGED
@@ -485,6 +485,19 @@ class Mega_Menu_Menu_Item_Manager {
485
  $return .= '<em>' . __("Option only available for top level menu items", "megamenu") . '</em>';
486
  }
487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  $return .= ' </td>';
489
  $return .= ' </tr>';
490
 
485
  $return .= '<em>' . __("Option only available for top level menu items", "megamenu") . '</em>';
486
  }
487
 
488
+ $return .= ' </td>';
489
+ $return .= ' </tr>';
490
+ $return .= ' <tr class="mega-menu-icon-position">';
491
+ $return .= ' <td class="mega-name">';
492
+ $return .= __("Icon Position", "megamenu");
493
+ $return .= ' </td>';
494
+ $return .= ' <td class="mega-value">';
495
+ $return .= ' <select id="mega-item-align" name="settings[icon_position]">';
496
+ $return .= ' <option value="left" ' . selected( $menu_item_meta['icon_position'], 'left', false ) . '>' . __("Left", "megamenu") . '</option>';
497
+ $return .= ' <option value="top" ' . selected( $menu_item_meta['icon_position'], 'top', false ) . '>' . __("Top", "megamenu") . '</option>';
498
+ $return .= ' <option value="right" ' . selected( $menu_item_meta['icon_position'], 'right', false ) . '>' . __("Right", "megamenu") . '</option>';
499
+ $return .= ' </select>';
500
+
501
  $return .= ' </td>';
502
  $return .= ' </tr>';
503
 
classes/nav-menus.class.php CHANGED
@@ -28,6 +28,7 @@ class Mega_Menu_Nav_Menus {
28
  'hide_sub_menu_on_mobile' => 'false',
29
  'hide_arrow' => 'false',
30
  'item_align' => 'left',
 
31
  'panel_columns' => 6, // total number of columns displayed in the panel
32
  'mega_menu_columns' => 1, // for sub menu items, how many columns to span in the panel,
33
  'mega_menu_order' => 0
@@ -165,7 +166,6 @@ class Mega_Menu_Nav_Menus {
165
  wp_deregister_script('color-box');
166
  wp_deregister_style('color-box-css');
167
 
168
-
169
  wp_enqueue_style( 'colorbox', MEGAMENU_BASE_URL . 'js/colorbox/colorbox.css', false, MEGAMENU_VERSION );
170
  wp_enqueue_style( 'mega-menu', MEGAMENU_BASE_URL . 'css/admin/menus.css', false, MEGAMENU_VERSION );
171
 
28
  'hide_sub_menu_on_mobile' => 'false',
29
  'hide_arrow' => 'false',
30
  'item_align' => 'left',
31
+ 'icon_position' => 'left',
32
  'panel_columns' => 6, // total number of columns displayed in the panel
33
  'mega_menu_columns' => 1, // for sub menu items, how many columns to span in the panel,
34
  'mega_menu_order' => 0
166
  wp_deregister_script('color-box');
167
  wp_deregister_style('color-box-css');
168
 
 
169
  wp_enqueue_style( 'colorbox', MEGAMENU_BASE_URL . 'js/colorbox/colorbox.css', false, MEGAMENU_VERSION );
170
  wp_enqueue_style( 'mega-menu', MEGAMENU_BASE_URL . 'css/admin/menus.css', false, MEGAMENU_VERSION );
171
 
classes/walker.class.php CHANGED
@@ -139,6 +139,10 @@ class Mega_Menu_Walker extends Walker_Nav_Menu {
139
  $item_output = $args->before;
140
  $item_output .= '<a'. $attributes .'>';
141
 
 
 
 
 
142
  if ( $settings['hide_text'] == 'true' ) {
143
  /** This filter is documented in wp-includes/post-template.php */
144
  } else if ( property_exists( $item, 'mega_description' ) && strlen( $item->mega_description ) ) {
@@ -147,6 +151,10 @@ class Mega_Menu_Walker extends Walker_Nav_Menu {
147
  $item_output .= $args->link_before . apply_filters( 'megamenu_the_title', $item->title, $item->ID ) . $args->link_after;
148
  }
149
 
 
 
 
 
150
  $item_output .= '</a>';
151
  $item_output .= $args->after;
152
 
139
  $item_output = $args->before;
140
  $item_output .= '<a'. $attributes .'>';
141
 
142
+ if ( in_array('icon-top', $classes ) ) {
143
+ $item_output .= "<span class='mega-title-below'>";
144
+ }
145
+
146
  if ( $settings['hide_text'] == 'true' ) {
147
  /** This filter is documented in wp-includes/post-template.php */
148
  } else if ( property_exists( $item, 'mega_description' ) && strlen( $item->mega_description ) ) {
151
  $item_output .= $args->link_before . apply_filters( 'megamenu_the_title', $item->title, $item->ID ) . $args->link_after;
152
  }
153
 
154
+ if ( in_array('icon-top', $classes ) ) {
155
+ $item_output .= "</span>";
156
+ }
157
+
158
  $item_output .= '</a>';
159
  $item_output .= $args->after;
160
 
classes/widget-manager.class.php CHANGED
@@ -78,8 +78,8 @@ class Mega_Menu_Widget_Manager {
78
  register_sidebar(
79
  array(
80
  'id' => 'mega-menu',
81
- 'name' => __("Mega Menu Widgets", "megamenu"),
82
- 'description' => __("Do not manually edit this area.", "megamenu")
83
  )
84
  );
85
  }
78
  register_sidebar(
79
  array(
80
  'id' => 'mega-menu',
81
+ 'name' => __("Max Mega Menu Widgets", "megamenu"),
82
+ 'description' => __("This is where Max Mega Menu stores widgets that you have added to sub menus using the mega menu builder. You can edit existing widgets here, but new widgets must be added through the Mega Menu interface (under Appearance > Menus).", "megamenu")
83
  )
84
  );
85
  }
css/megamenu.scss CHANGED
@@ -106,6 +106,43 @@
106
  }
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  > li.mega-animating > ul.mega-sub-menu {
110
  pointer-events: none;
111
  }
@@ -553,6 +590,7 @@
553
  text-decoration: $panel_third_level_text_decoration;
554
  font-weight: $panel_third_level_font_weight;
555
  margin: 0;
 
556
  padding: $panel_third_level_padding_top $panel_third_level_padding_right $panel_third_level_padding_bottom $panel_third_level_padding_left;
557
  vertical-align: top;
558
  display: block;
106
  }
107
  }
108
 
109
+
110
+ li.mega-menu-item.mega-icon-top > a.mega-menu-link {
111
+ display: table-cell;
112
+ vertical-align: middle;
113
+ line-height: initial;
114
+
115
+ &:before {
116
+ display: block;
117
+ margin: 0 0 6px 0;
118
+ text-align: center;
119
+ }
120
+
121
+ > span.mega-title-below {
122
+ display: inline-block;
123
+ }
124
+ }
125
+
126
+ @include mobile {
127
+ > li.mega-menu-item.mega-icon-top > a.mega-menu-link {
128
+ display: block;
129
+ line-height: $mobile_menu_item_height;
130
+
131
+ &:before {
132
+ display: inline-block;
133
+ margin: 0 6px 0 0;
134
+ text-align: left;
135
+ }
136
+ }
137
+ }
138
+
139
+ li.mega-menu-item.mega-icon-right > a.mega-menu-link {
140
+ &:before {
141
+ float: right;
142
+ margin: 0 0 0 6px;
143
+ }
144
+ }
145
+
146
  > li.mega-animating > ul.mega-sub-menu {
147
  pointer-events: none;
148
  }
590
  text-decoration: $panel_third_level_text_decoration;
591
  font-weight: $panel_third_level_font_weight;
592
  margin: 0;
593
+ border: 0;
594
  padding: $panel_third_level_padding_top $panel_third_level_padding_right $panel_third_level_padding_bottom $panel_third_level_padding_left;
595
  vertical-align: top;
596
  display: block;
integration/generatepress/functions.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // disable direct access
5
+ }
6
+
7
+ /**
8
+ * Append integration CSS
9
+ */
10
+ function megamenu_generatepress_style($scss) {
11
+ $path = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'style.scss';
12
+ $contents = file_get_contents( $path );
13
+ return $scss . $contents;
14
+ }
15
+ add_filter( 'megamenu_load_scss_file_contents', 'megamenu_generatepress_style', 9999 );
integration/generatepress/style.scss ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ @if $location == 'primary' {
2
+ body.mega-menu-primary button.menu-toggle {
3
+ display: none;
4
+ }
5
+ }
integration/twentytwelve/functions.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // disable direct access
5
+ }
6
+
7
+ /**
8
+ * Append integration CSS
9
+ */
10
+ function megamenu_twentytwelve_style($scss) {
11
+ $path = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'style.scss';
12
+ $contents = file_get_contents( $path );
13
+ return $scss . $contents;
14
+ }
15
+ add_filter( 'megamenu_load_scss_file_contents', 'megamenu_twentytwelve_style', 9999 );
integration/twentytwelve/style.scss ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ @if $location == 'primary' {
2
+ body.mega-menu-primary button.menu-toggle {
3
+ display: none;
4
+ }
5
+ }
js/maxmegamenu.js CHANGED
@@ -171,7 +171,7 @@
171
 
172
  items_with_submenus.on("click.megamenu touchend.megamenu", function(e) {
173
 
174
- if ($(this).parent().hasClass("mega-toggle-on") && $(this).parent().parent().parent().hasClass("mega-menu-tabbed")) {
175
  e.preventDefault();
176
  return;
177
  }
171
 
172
  items_with_submenus.on("click.megamenu touchend.megamenu", function(e) {
173
 
174
+ if (plugin.isDesktopView() && $(this).parent().hasClass("mega-toggle-on") && $(this).parent().parent().parent().hasClass("mega-menu-tabbed")) {
175
  e.preventDefault();
176
  return;
177
  }
megamenu.php CHANGED
@@ -4,7 +4,7 @@
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.3
8
  * Author: Tom Hemsley
9
  * Author URI: https://www.megamenu.com
10
  * License: GPL-2.0+
@@ -26,7 +26,7 @@ final class Mega_Menu {
26
  /**
27
  * @var string
28
  */
29
- public $version = '2.3.3';
30
 
31
 
32
  /**
@@ -136,7 +136,6 @@ final class Mega_Menu {
136
  do_action( 'sidebar_admin_setup' );
137
  do_action( 'admin_enqueue_scripts', 'widgets.php' );
138
  do_action( 'admin_print_styles-widgets.php' );
139
-
140
  do_action( 'megamenu_nav_menus_scripts', $hook );
141
  }
142
 
@@ -326,15 +325,21 @@ final class Mega_Menu {
326
 
327
  }
328
 
 
 
 
 
 
329
 
330
- switch(get_template()) {
331
  case "twentyseventeen":
332
- require_once( MEGAMENU_PATH . 'integration/twentyseventeen/functions.php' );
333
- break;
334
  case "zerif":
335
- case "zerif-pro":
336
- require_once( MEGAMENU_PATH . 'integration/zerif/functions.php' );
337
- break;
 
338
  }
339
  }
340
 
@@ -694,6 +699,10 @@ final class Mega_Menu {
694
  $item->classes[] = 'has-icon';
695
  }
696
 
 
 
 
 
697
  if ( $item->megamenu_settings['hide_text'] == 'true' && $item->depth === 0 ) {
698
  $item->classes[] = 'hide-text';
699
  }
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.4
8
  * Author: Tom Hemsley
9
  * Author URI: https://www.megamenu.com
10
  * License: GPL-2.0+
26
  /**
27
  * @var string
28
  */
29
+ public $version = '2.3.4';
30
 
31
 
32
  /**
136
  do_action( 'sidebar_admin_setup' );
137
  do_action( 'admin_enqueue_scripts', 'widgets.php' );
138
  do_action( 'admin_print_styles-widgets.php' );
 
139
  do_action( 'megamenu_nav_menus_scripts', $hook );
140
  }
141
 
325
 
326
  }
327
 
328
+ $template = get_template();
329
+
330
+ if ($template == 'zerif-pro') {
331
+ $template = 'zerif';
332
+ }
333
 
334
+ switch ( $template ) {
335
  case "twentyseventeen":
336
+ case "generatepress":
337
+ case "twentytwelve":
338
  case "zerif":
339
+ if ( is_readable( MEGAMENU_PATH . "integration/{$template}/functions.php" ) ) {
340
+ require_once( MEGAMENU_PATH . "integration/{$template}/functions.php" );
341
+ }
342
+ break;
343
  }
344
  }
345
 
699
  $item->classes[] = 'has-icon';
700
  }
701
 
702
+ if ( $item->megamenu_settings['icon_position'] != 'left' ) {
703
+ $item->classes[] = "icon-" . $item->megamenu_settings['icon_position'];
704
+ }
705
+
706
  if ( $item->megamenu_settings['hide_text'] == 'true' && $item->depth === 0 ) {
707
  $item->classes[] = 'hide-text';
708
  }
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.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -103,6 +103,12 @@ See https://www.megamenu.com for more screenshots
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
106
  = 2.3.3 [29/12/16] =
107
 
108
  * Fix: Compatibility with WPML Language switcher
@@ -113,7 +119,7 @@ See https://www.megamenu.com for more screenshots
113
  * Fix: Theme changes not being applied when PolyLang used in conjunction with the "Output in <head>" option
114
  * Fix: JavaScript error when a dynamic width has been used for the sub menu, but the matching element does not exist on the page
115
 
116
- = 2.3.1 [21/12/16]=
117
 
118
  * Improvement: Theme Editor switched to tabbed interface
119
  * Improvement: Theme Editor now uses AJAX save so you don't lose your place in the theme editor
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.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
103
 
104
  == Changelog ==
105
 
106
+ = 2.3.4 [15/01/16] =
107
+
108
+ * New: Automatic integration for GeneratePress and Twenty Twelve (hide duplicate mobile button)
109
+ * New: "Icon Position" option added in the menu item settings (left, top, right) (requires clearing the Mega Menu CSS under Mega Menu > Tools)
110
+ * Fix: JavaScript fix for tabbed mobile menus
111
+
112
  = 2.3.3 [29/12/16] =
113
 
114
  * Fix: Compatibility with WPML Language switcher
119
  * Fix: Theme changes not being applied when PolyLang used in conjunction with the "Output in <head>" option
120
  * Fix: JavaScript error when a dynamic width has been used for the sub menu, but the matching element does not exist on the page
121
 
122
+ = 2.3.1 [21/12/16] =
123
 
124
  * Improvement: Theme Editor switched to tabbed interface
125
  * Improvement: Theme Editor now uses AJAX save so you don't lose your place in the theme editor