Admin Menu Editor - Version 1.1.11

Version Description

  • Tested on WP 3.4.2 and WP 3.5-alpha-21879.
  • Fixed a visual glitch related to the arrow that's used to expand menu settings. In certain situations clicking it would cause the arrow icon to be briefly replaced with multiple copies of the same icon.
  • Fixed the position of the URL and capability dropdown lists. Now they should show up directly under the corresponding input box instead of appearing some distance down and to the right.
  • Fixed the size of the toolbar buttons - now they're perfectly square.
  • Fixed a rare bug that would sometimes cause the wrong menu to be marked as active/expanded.
  • Only display the survey notice on the menu editor page, not on all admin pages.
Download this release

Release Info

Developer whiteshadow
Plugin Icon 128x128 Admin Menu Editor
Version 1.1.11
Comparing to
See all releases

Code changes from version 1.1.10 to 1.1.11

css/menu-editor.css CHANGED
@@ -122,6 +122,11 @@ a.ws_edit_link:hover {
122
  background-image: url('../images/bullet_arrow_down2.png');
123
  }
124
 
 
 
 
 
 
125
  .ws_edit_link_expanded {
126
  background-color: #ffffd0;
127
  border-bottom: none;
@@ -383,6 +388,9 @@ to accomodate the dropdown button.
383
  padding: 4px;
384
  border: 1px solid #c0c0e0;
385
  float: left;
 
 
 
386
 
387
  border-radius: 3px;
388
  -moz-border-radius: 3px;
122
  background-image: url('../images/bullet_arrow_down2.png');
123
  }
124
 
125
+ .ws_edit_link:active {
126
+ background-repeat: no-repeat;
127
+ background-position: center;
128
+ }
129
+
130
  .ws_edit_link_expanded {
131
  background-color: #ffffd0;
132
  border-bottom: none;
388
  padding: 4px;
389
  border: 1px solid #c0c0e0;
390
  float: left;
391
+
392
+ width: 16px;
393
+ height: 16px;
394
 
395
  border-radius: 3px;
396
  -moz-border-radius: 3px;
includes/menu-editor-core.php CHANGED
@@ -173,7 +173,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
173
  'menu-editor',
174
  plugins_url('js/menu-editor.js', $this->plugin_file),
175
  array('jquery', 'jquery-ui-sortable', 'jquery-ui-dialog', 'jquery-form'),
176
- '1.1'
177
  );
178
 
179
  //The editor will need access to some of the plugin data and WP data.
@@ -193,7 +193,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
193
  * @return void
194
  */
195
  function enqueue_styles(){
196
- wp_enqueue_style('menu-editor-style', plugins_url('css/menu-editor.css', $this->plugin_file), array(), '20120626');
197
  }
198
 
199
  /**
@@ -1069,6 +1069,16 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
1069
  $hint_id = 'ws_sidebar_pro_ad';
1070
  $show_pro_benefits = !apply_filters('admin_menu_editor_is_pro', false) && (!isset($show_hints[$hint_id]) || $show_hints[$hint_id]);
1071
  if ( $show_pro_benefits ):
 
 
 
 
 
 
 
 
 
 
1072
  ?>
1073
  <div class="clear"></div>
1074
 
@@ -1077,11 +1087,11 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
1077
  <div class="ws_hint_content">
1078
  <strong>Upgrade to Pro:</strong>
1079
  <ul>
1080
- <li>Menu export & import.</li>
1081
- <li>Per-role menu permissions.</li>
1082
- <li>Drag items between menu levels.</li>
1083
  </ul>
1084
- <a href="http://w-shadow.com/admin-menu-editor-pro/upgrade-to-pro/?utm_source=Admin%2BMenu%2BEditor%2Bfree&utm_medium=text_link&utm_content=sidebar_link&utm_campaign=Plugins" target="_blank">Learn more</a>
1085
  </div>
1086
  </div>
1087
  <?php
@@ -1342,7 +1352,7 @@ window.wsMenuEditorPro = false; //Will be overwritten if extras are loaded
1342
  'ame-menu-fix',
1343
  plugins_url('js/menu-highlight-fix.js', $this->plugin_file),
1344
  array('jquery'),
1345
- '20120709',
1346
  true
1347
  );
1348
  }
@@ -1370,6 +1380,9 @@ window.wsMenuEditorPro = false; //Will be overwritten if extras are loaded
1370
  $display_notice = $display_notice && ((time() - $this->options['first_install_time']) > $minimum_usage_period);
1371
  }
1372
 
 
 
 
1373
  if ( $display_notice ) {
1374
  $free_survey_url = 'https://docs.google.com/spreadsheet/viewform?formkey=dERyeDk0OWhlbkxYcEY4QTNaMnlTQUE6MQ';
1375
  $pro_survey_url = 'https://docs.google.com/spreadsheet/viewform?formkey=dHl4MnlHaVI3NE5JdVFDWG01SkRKTWc6MA';
173
  'menu-editor',
174
  plugins_url('js/menu-editor.js', $this->plugin_file),
175
  array('jquery', 'jquery-ui-sortable', 'jquery-ui-dialog', 'jquery-form'),
176
+ '20120915'
177
  );
178
 
179
  //The editor will need access to some of the plugin data and WP data.
193
  * @return void
194
  */
195
  function enqueue_styles(){
196
+ wp_enqueue_style('menu-editor-style', plugins_url('css/menu-editor.css', $this->plugin_file), array(), '20120915');
197
  }
198
 
199
  /**
1069
  $hint_id = 'ws_sidebar_pro_ad';
1070
  $show_pro_benefits = !apply_filters('admin_menu_editor_is_pro', false) && (!isset($show_hints[$hint_id]) || $show_hints[$hint_id]);
1071
  if ( $show_pro_benefits ):
1072
+ $benefit_variations = array(
1073
+ 'Simplified, role-based permissions.',
1074
+ 'Role-based menu permissions',
1075
+ 'Per-role menu permissions',
1076
+ );
1077
+ //Pseudo-randomly select one phrase based on the site URL.
1078
+ $variation_index = hexdec( substr(md5(get_site_url()), -1) ) % count($benefit_variations);
1079
+ $selected_variation = $benefit_variations[$variation_index];
1080
+
1081
+ $pro_version_link = 'http://w-shadow.com/admin-menu-editor-pro/upgrade-to-pro/?utm_source=Admin%2BMenu%2BEditor%2Bfree&utm_medium=text_link&utm_content=sidebar_link_bv' . $variation_index . '&utm_campaign=Plugins';
1082
  ?>
1083
  <div class="clear"></div>
1084
 
1087
  <div class="ws_hint_content">
1088
  <strong>Upgrade to Pro:</strong>
1089
  <ul>
1090
+ <li><?php echo $selected_variation; ?></li>
1091
+ <li>Drag items between menu levels.</li>
1092
+ <li>Menu export & import.</li>
1093
  </ul>
1094
+ <a href="<?php echo esc_attr($pro_version_link); ?>" target="_blank">Learn more</a>
1095
  </div>
1096
  </div>
1097
  <?php
1352
  'ame-menu-fix',
1353
  plugins_url('js/menu-highlight-fix.js', $this->plugin_file),
1354
  array('jquery'),
1355
+ '20120915',
1356
  true
1357
  );
1358
  }
1380
  $display_notice = $display_notice && ((time() - $this->options['first_install_time']) > $minimum_usage_period);
1381
  }
1382
 
1383
+ //Only display the notice on the Menu Editor page.
1384
+ $display_notice = $display_notice && isset($this->get['page']) && ($this->get['page'] == 'menu_editor');
1385
+
1386
  if ( $display_notice ) {
1387
  $free_survey_url = 'https://docs.google.com/spreadsheet/viewform?formkey=dERyeDk0OWhlbkxYcEY4QTNaMnlTQUE6MQ';
1388
  $pro_survey_url = 'https://docs.google.com/spreadsheet/viewform?formkey=dHl4MnlHaVI3NE5JdVFDWG01SkRKTWc6MA';
js/menu-editor.js CHANGED
@@ -838,20 +838,25 @@ $(document).ready(function(){
838
  return;
839
  }
840
  dropdown.currentOwner = this; //Got ye now!
841
-
 
 
 
 
 
 
842
  //Move the dropdown near to the button
843
  var inputPos = inputBox.offset();
844
- dropdown.list.css({
845
- position: 'absolute',
846
- left: inputPos.left,
847
- top: inputPos.top + inputBox.outerHeight()
848
- });
849
-
850
- //Pre-select the current capability (will clear selection if there's no match)
851
- dropdown.list.val(inputBox.val());
852
-
853
- dropdown.list.show();
854
- dropdown.list.focus();
855
  });
856
 
857
  //Also show it when the user presses the down arrow in the input field
838
  return;
839
  }
840
  dropdown.currentOwner = this; //Got ye now!
841
+
842
+ //Pre-select the current capability (will clear selection if there's no match)
843
+ dropdown.list.val(inputBox.val());
844
+
845
+ //Show the list before moving it into place. This ensures the position will be calc. properly.
846
+ dropdown.list.show();
847
+
848
  //Move the dropdown near to the button
849
  var inputPos = inputBox.offset();
850
+ dropdown.list
851
+ .css({
852
+ position: 'absolute'
853
+ })
854
+ .offset({
855
+ left: inputPos.left,
856
+ top: inputPos.top + inputBox.outerHeight()
857
+ });
858
+
859
+ dropdown.list.focus();
 
860
  });
861
 
862
  //Also show it when the user presses the down arrow in the input field
js/menu-highlight-fix.js CHANGED
@@ -45,12 +45,19 @@ jQuery(function($) {
45
  isTopMenu : false
46
  };
47
 
48
- $('#adminmenu li > a').each(function(index, link) {
 
 
 
 
 
 
 
49
  var $link = $(link);
50
 
51
  //Skip "#" links. Some plugins (e.g. S2Member 120703) use such no-op items as menu dividers.
52
  if ($link.attr('href') == '#') {
53
- return true;
54
  }
55
 
56
  var uri = parseUri(link.href);
@@ -63,7 +70,7 @@ jQuery(function($) {
63
  }
64
 
65
  if (!isCloseMatch) {
66
- return true; //Skip to the next link.
67
  }
68
 
69
  //Calculate the number of matching and different query parameters.
@@ -145,8 +152,10 @@ jQuery(function($) {
145
  //Account for users who use a plugin to keep all menus expanded.
146
  var shouldCloseOtherMenus = $('li.wp-has-current-submenu', '#adminmenu').length <= 1;
147
  if (shouldCloseOtherMenus) {
148
- otherHighlightedMenus.removeClass('wp-menu-open');
149
- otherHighlightedMenus.removeClass('wp-has-current-submenu current').addClass('wp-not-current-submenu');
 
 
150
  }
151
 
152
  var parentMenuAndLink = parentMenu.add('> a.menu-top', parentMenu);
@@ -157,7 +166,7 @@ jQuery(function($) {
157
  }
158
 
159
  if (isWrongItemHighlighted) {
160
- $('#adminmenu .current').removeClass('current');
161
  bestMatchLink.addClass('current').closest('li').addClass('current');
162
  }
163
  }
45
  isTopMenu : false
46
  };
47
 
48
+ //Special case: ".../wp-admin/" should match ".../wp-admin/index.php".
49
+ if (currentUri.path.match(/\/wp-admin\/$/)) {
50
+ currentUri.path = currentUri.path + 'index.php';
51
+ }
52
+
53
+ var adminMenu = $('#adminmenu');
54
+
55
+ adminMenu.find('li > a').each(function(index, link) {
56
  var $link = $(link);
57
 
58
  //Skip "#" links. Some plugins (e.g. S2Member 120703) use such no-op items as menu dividers.
59
  if ($link.attr('href') == '#') {
60
+ return;
61
  }
62
 
63
  var uri = parseUri(link.href);
70
  }
71
 
72
  if (!isCloseMatch) {
73
+ return; //Skip to the next link.
74
  }
75
 
76
  //Calculate the number of matching and different query parameters.
152
  //Account for users who use a plugin to keep all menus expanded.
153
  var shouldCloseOtherMenus = $('li.wp-has-current-submenu', '#adminmenu').length <= 1;
154
  if (shouldCloseOtherMenus) {
155
+ otherHighlightedMenus
156
+ .add('> a', otherHighlightedMenus)
157
+ .removeClass('wp-menu-open wp-has-current-submenu current')
158
+ .addClass('wp-not-current-submenu');
159
  }
160
 
161
  var parentMenuAndLink = parentMenu.add('> a.menu-top', parentMenu);
166
  }
167
 
168
  if (isWrongItemHighlighted) {
169
+ adminMenu.find('.current').removeClass('current');
170
  bestMatchLink.addClass('current').closest('li').addClass('current');
171
  }
172
  }
menu-editor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Admin Menu Editor
4
  Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
5
  Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
6
- Version: 1.1.10
7
  Author: Janis Elsts
8
  Author URI: http://w-shadow.com/
9
  */
3
  Plugin Name: Admin Menu Editor
4
  Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
5
  Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
6
+ Version: 1.1.11
7
  Author: Janis Elsts
8
  Author URI: http://w-shadow.com/
9
  */
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: whiteshadow
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
4
  Tags: admin, dashboard, menu, security, wpmu
5
  Requires at least: 3.2
6
- Tested up to: 3.4.1
7
- Stable tag: 1.1.10
8
 
9
  Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
10
 
@@ -63,6 +63,14 @@ Plugins installed in the `mu-plugins` directory are treated as "always on", so y
63
 
64
  == Changelog ==
65
 
 
 
 
 
 
 
 
 
66
  = 1.1.10 =
67
  * Added a new user survey. The notice will only appear for users who didn't complete or hide the previous one.
68
  * Fixed a number of bugs in the code that determines which menu should be expanded.
@@ -165,5 +173,8 @@ Plugins installed in the `mu-plugins` directory are treated as "always on", so y
165
 
166
  == Upgrade Notice ==
167
 
 
 
 
168
  = 1.1.9 =
169
  Optional upgrade. Just adds a couple of screenshots for the WordPress.org plugin description.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
4
  Tags: admin, dashboard, menu, security, wpmu
5
  Requires at least: 3.2
6
+ Tested up to: 3.4.2
7
+ Stable tag: 1.1.11
8
 
9
  Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
10
 
63
 
64
  == Changelog ==
65
 
66
+ = 1.1.11 =
67
+ * Tested on WP 3.4.2 and WP 3.5-alpha-21879.
68
+ * Fixed a visual glitch related to the arrow that's used to expand menu settings. In certain situations clicking it would cause the arrow icon to be briefly replaced with multiple copies of the same icon.
69
+ * Fixed the position of the URL and capability dropdown lists. Now they should show up directly under the corresponding input box instead of appearing some distance down and to the right.
70
+ * Fixed the size of the toolbar buttons - now they're perfectly square.
71
+ * Fixed a rare bug that would sometimes cause the wrong menu to be marked as active/expanded.
72
+ * Only display the survey notice on the menu editor page, not on all admin pages.
73
+
74
  = 1.1.10 =
75
  * Added a new user survey. The notice will only appear for users who didn't complete or hide the previous one.
76
  * Fixed a number of bugs in the code that determines which menu should be expanded.
173
 
174
  == Upgrade Notice ==
175
 
176
+ = 1.1.11 =
177
+ This version fixes several minor bugs and layout problems.
178
+
179
  = 1.1.9 =
180
  Optional upgrade. Just adds a couple of screenshots for the WordPress.org plugin description.