Admin Menu Editor For WordPress
Here is my latest and hack-iest plugin yet – Admin Menu Editor. It’s a WordPress plugin that will let you manually edit the Dashboard menu. You can reorder the menus, show/hide specific items, change access rights, and more. The plugin is still a bit rough around the edges, so a good understading of WP internals is recommended (but not required).
Features
- Sort menu items any way you want by simple drag & drop.
- Move a menu item to a different submenu via cut & paste. Note that if you move an item that belongs to a plugin, you will need to modify the “File” attribute to point to the right parent file (e.g. instead of “akismet-key-config” use “options-general.php?page=akismet-key-config”).
- Edit any existing menu – change the title, access rights, menu icon and so on. Note that you can’t lower the required access rights, but you can change them to be more restrictive.
- Hide/show any menu or menu item. A hidden menu is invisible to all users, including administrators.
- Create custom menus that point to any part of the Dashboard. For example, you could create a new menu leading directly to the “Pending comments” page.
Here’s a screenshot :
Download
admin-menu-editor.zip (33 KB)
Requirements :
- WordPress 2.7 or later
- PHP 5 or later
Known Issues
The basic idea for the plugin was suggested by several commenters way back in October. However, the internal menu system that WordPress uses is obscure and unsuitable for direct manipulation, so I spent quite a while inventing workarounds. And even after a few weeks of pondering, there are some things I haven’t quite fixed.
- If you delete any of the default menus they will reappear after saving. This is not a bug, it’s a feature
- As I mentioned before, the access rights required for using a particular menu item can’t be lowered, but can be made more strict. I think.
- Also, a plugin’s menu that is moved to a different submenu will not work unless you also include the parent file in the “File” field. This is because WP “ties” the menu item to it’s parent menu and won’t recognize it in a different submenu.
- If you create a custom menu (or change the “File” setting of an existing menu), be sure to tick the “Custom” checkbox. Otherwise that item will not show up in the final Dashboard menu.
Merry Christmas, by the way

Wanted to let you know that the plugin author URL links back to http://w-shadow.com/blog/2008/12/20/admin-menu-edi%EF%BF%BD-for-wordpress/ which doesn’t exist. Also, I think it would be cool if you provided 1-3 options of sorting menus. For instance, I’d simply like the menu to be rearranged in alphabetical order. Other than that, I’m having fun dragging and dropping.
Fixed. I thought about adding sort buttons, but decided to leave them out in the first release. So it’s probable I’ll add this feature eventually.
[...] att passa in på eyesx.com. Klicka på “Läs mer” för att se hela listan av tillägg. Admin Menu Editor – Ett meny tillägg för att arrangera ordningen av de nya menyn i 2.7. Av Janis [...]
Hi, I’m getting a syntax error when I’m trying to activate the plugin
“Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /var/www/…/wordpress/wp-content/plugins/menu-editor/menu-editor.php on line 26″
You probably have an old version of PHP. This plugin requires PHP 5 or later.
hi!
many thanks for this plugin.
unfortunately i get a fatal error while activating this plugin:
Fatal error: Cannot redeclare class Services_JSON in /var/www/stpa/wp-content/plugins/menu-editor/JSON.php on line 116
Should be fixed now. Download again from the same link.
[...] Admin Menu Editor [...]
it works now! many thanks!
Could this plug-in be extended to hide menus on the post page such as:
Tags
Categories
Excerpt
Send Trackbacks
Custom Fields
Discussion
Post Arthur
An example would be greatly appreciated!
Nevermind, found this great plugin:
http://wordpress.org/extend/plugins/wp-cms-post-control/
THANKS!
@Dorian – That type of functionality is provided by WordPress 2.7 as part of the major UI changes/redesign they did. Sounds like you are not using WordPress 2.7 which I highly encourage you to do so.
I have installed the plugin and get the buttons at the top, however I am not getting any of the menu items below. I did not see any readme file, so I am assuming its as easy as uploading and activating. Any ideas?
That’s probably some kind of JavaScript error. I’ll need to know the error message to find the exact problem.
Various browsers have different ways to view JS error messages. AFAIK, Firefox has multiple addons that will let you do that (Firebug, Web Developer, etc). In Opera, it’s Tools -> Advanced -> Error Console. As for IE… I think there’s a little “error” icon in the lower-left corner of the status bar that you can double-click to show the last error message.
Hi.
Great Plugin! One question though – is it possible to change the level of menus? I try to move “posts” into “pages” (just as a couple of custom post types created by flutter) and that doesn’t seem to work. If it’s not currently possible, that would be really useful (hopefully not just for me, but for everyone using WP as a CMS).
Thanks again!
@Tobias : You can’t directly change the level – make a top menu a submenu or vice versa – but you could create a new custom (sub)menu that has the same properties as the menu you would like to move.
I’m not entirely sure what you’re trying to do there, but if you want to move some submenus to a different toplevel menu (e.g. move “Add New [Post]” to the “Pages” menu), you can do that via cut & paste.
This plugin is the magic bullet if you are trying to setup WordPress as a CMS with limited admin views for your clients!!! Use this plug-in. It works great!
This is the best plugin for WP, period. Elegant execution, and amazingly powerful.
One question: how can I hack this bad boy to have the menu links to point to root admin pages when inside a sub-blog on a WordPress Multi User (WPMU) install?
I’ll explain what I mean.
Let’s say I’m the admin of a WPMU install, and I decide to edit or write a post on a sub-blog. Well, in doing I so I actually enter the sub-blog’s admin section. This means that all the menu URL’s are based on the sub-blog that I’m now inside of.
So instead of: wp/wp-admin/edit.php
the menu links are wp/subblog/wp-admin/edit.php
What can I do inside the plugin to have the urls in the custom menu point to the root admin?
FWIW, no users will have access to admin whatsoever. One admin, and the sub-blogs are for readers only.
Hmm, I don’t have a WPMU install to test this, but have you tried starting the link with a slash?
For example, if the your full root URL is “http://domain.com/wp/wp-admin/edit.php”, enter “/wp/wp-admin/edit.php”. This seems to work on my single-user testblog.
WUNDERBAR!
This works perfectly. So for anyone who cares:
If using WPMU and you want the menu links for admin to be based on the root installation, even when you have clicked-down into a sub-blog’s admin, adding a slash and the folder name of your install (for example: /wp/) will get er done.
This is important if you;re using WPMU as a CMS, with only one admin presiding over all the sub-blogs (like one might do with a membership/subscription site).
There’s still some buggy behaviour wither certain menu items, and in order for it to work, you need to edit the menu BEFORE you create sub-blogs, but it’s regardless, it’s worth a shot.
White Shadow for president.
I said buggy in my last comment. What I meant was:
when changing links to a default menu, it creates a duplicate item. So what you need to do is create a new item (from scratch or via copy/paste), HIDE the original menu item, then make the desired modifications to the new menu item.
Mhm, that’s a known issue – the plugin identifies menu items based on their URL, so if you change the URL the menu item will be treated as a new item. At the moment there’s no way to change this without making the already hacky “plugin menu <— > WP menu” interface an even greater mess.
As you said, it’s not a but it’s a feature!
It’s a very issue considering how powerful this plugin is.
And, fwiw, it seems to be working 100% on WPMU. Again, excellent work.
Thanks
Hi im experiencing a problem where the menu items are not dragging or dropping or anything. is this a javascript problem?
Yep, probably a JS issue. Try a different browser. Also, there might be a conflict with another plugin that uses JS (I haven’t encountered any conflicting plugins myself, but it’s possible).
I knew it would have been too good to be true to expect this to work with the fluency2 admin interface – and it was. If you want brownie points, it would be awesome to use both your plugin and the fluency2 one. (upon saving any changes in your interface and refreshing, the entire page goes blank) Otherwise, great plugin. Here is fluency2 in case your interested:
http://deanjrobinson.com/projects/fluency-admin/
Actually, I spoke too soon, I get an error even when that plugin is not installed. Here is the error:
PHP Fatal error: Cannot use object of type stdClass as array in /home/dev-coding411/public_html/wp-content/plugins/menu-editor/menu-editor.php on line 395
The code is as follows:
//Add the new entry to the menu tree
$tree[$topfile] = $entry;
Any ideas? Maybe it will work after all once this is resolved.
Hmm, apparently my “backwards-compatible” JSON decoding function wasn’t really all that “compatible”. It would return an object even when an associative array was requested. This should be fixed now.
Same issue – It doesnt look like there are any changes in the new download. Has it been updated?
Should be 0.1.2 now, was 0.1.1 before.
In any case, I’m still pretty sure it’s the JSON thing. I’ll run more tests tomorrow.
Ah – maybe it was fixed, but the download is still showing 0.1.1 – just downloaded again to verify.
may just need to update download link. Or is there some otherplace to download betas that I am missing?
I tried the link just now and it’s showing 0.1.2 for me. Perhaps some kind of web cache on your end?
Sweet – I had to download it in IE to get latest. Not sure why caching in Firefox.
Loaded it and it works! Thanks!
a simple name, but a plugin with decent effects – it works great and is capable of a lot more than I need at the moment, and above all so sweet in ajax!
BUT ) :
only on my localhost! (Ubuntu Intrepid)
When I moved the things to my server, the javascript breaks “somehow”:
Firefox’ Error Console sez:
Error: menu.defaults is undefined
Source File: http://…/wp-content/plugins/menu-editor/menu-editor.js?ver=2.7
Line: 110
(note: I don’t get this error on my localhost)
Server is: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch7 mod_perl/2.0.2 Perl/v5.8.8 Server at … Port 80
I also tried different browsers and a windows box but it didn’t work out…
I’ve thought about this and got nowhere. I’d need to see the problem firsthand to figure it out.
You might try debugging the script yourself; I’d be happy to help with that
The first thing I’d check is whether the JSON-encoded menu structure (on the editor’s page) contains the “defaults” array for each menu item. If yes, there might be something wrong with the jQuery JSON plugin I use. If no, the next thing to check is the wp2tree() function in the .php file…
Awesome plugin!
Is there any way to transfer the settings that I’ve made on one blog to another blog or installation of wordpress? Can it be exported or something?
Thanks!
David
Not in this version, but thanks for the idea.
This is a wonderful idea for a plugin and exactly the kind of thing I was searching for. I see above that you’re aware of the issue with the broken links when an item is moved over. It would definitely be nice if at least the path can be automatically included in the file field so that there aren’t so many broken links. I think that’s the biggest downside to this plugin.
I’m a PHP developer, but never created any WordPress Plugin so I’m not sure if that’s even possible with the way WordPress is setup. Just saying.
However, you have done a great job so far and I will eagerly be awaiting updates! Thank you for making this plugin!
Another suggestion for the future that would be really nice is the ability to drag menu items between one menu and another instead of having to cut and paste.
Thanks again for the plugin!
My problem got solved somehow – I don’t know what changed but now it works without bugs. It even stoped duplicating the qTranslate Language Buttons!
I’m perfectly happy now! Thanks for your work and efforts and your quick reply!
ups – the duplicate qTranslate buttons reappeared. But as they all work I don’t mind (:
White Shadow,
I want to thank you for creating this plugin! It’s just what I was looking for. It’s working perfectly so far. Well designed UI as well.
I’m excited to watch Admin Menu Editor evolve as you add functionality.
Thank you again,
Steve
I too would love to see the ability to save custom menu configurations for use in other blogs or within the same site. This would save a lot of time and effort.
Any thoughts on adding functionality for menu link color and icon mods?
You can already change the icons for top-level menus (i.e. the “Icon URL” field), though you’d have to manually upload the right icons to wp-admin/images/ for that to work. Changing colors would require a custom stylesheet. Hmm.
Eh, so that’s another item on my huge idea list. The suggestions wouldn’t be too hard to implement, but there’s so much other stuff I could/should work on that I can’t say when/if I’ll get to updating plugin.
Hi there
Great work on the plugin!!! but after upgrading to WP 2.7.1 it’s stopped working!! I’m now getting a blank screen when I try to activate the plugin, with the error
“PHP Fatal error: Cannot use object of type stdClass as array in /****/*******/public_html/wp-content/plugins/menu-editor/menu-editor.php on line 395″
I noticed in the comments that you’ve released version 0.1.2 which fixes this, but the download link still seems to be for 0.1.1?!?
Any help would be greatly appreciated!!
Hmm, I see. Apparently this problem is caused by a conflict with Simple Tags. It has the same bug as this plugin had prior to 0.1.2 and it happens to define the buggy function before Admin Menu Editor can create the correct one. I’ve uploaded a new version (0.1.3) that should fix this issue.
White Shadow
Thanks for getting back so quickly. I disabled all my other plugins and installed the new 0.1.3 version but still getting the blank screen once it’s activated!!!
Try this : manually delete this plugin and reinstall it anew. Maybe there’s an old file somewhere that creates problems.
Nope still no luck unfortunately
Well, are you still getting the same error message (which should be impossible as there is no line 395 in that file anymore)?
The error is now on line 380 as follows:
Cannot use object of type stdClass as array in /****/*******/public_html/wp-content/plugins/menu-editor/menu-editor-core.php on line 380
I’m out of ideas for the time being.
Hi,
I’ve just installed WP 2.7.1 and don’t have any other plugins installed yet. When I try to activate Admin Menu Editor v 0.1.3 I get this “fatal error”:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /homepages/18/d90242274/htdocs/themetest/wp-content/plugins/menu-editor/menu-editor-core.php on line 13
Any ideas? thank you so much!
Michelle
You probably have an old version of PHP. You will need at least PHP 5 to use this plugin.
I’m using PHP 5, hosted on 1and1.
I am running two different WP sites in this database, however, using different – what’s the opposite of extension? pretension? lol – different pre-something-or-others for the table names: wp_tt_ and wp_zz_. Would that make any difference?
Thanks again for your help!
Michelle
It’s called the “prefix”, and that shouldn’t make a difference.
The error is on a line that declares a protected class variable. Protected variables were introduced in PHP 5. If they don’t work I can only conclude that you don’t in fact have PHP 5
I bow to you; I am an idiot. Whatever brand of dyslexia I have had me reading “PHP 5″ and thinking “MySQL 5″. I have upgraded to PHP 5 and all now works perfectly.
Apologies for the stupid user error and thank you a hundred times for your patience. And for coming up with the word “prefix”. Sheesh. I am so glad yesterday is over.
No problem
I like your plugin. It installed and functions perfectly except for the moving links issue. Someone mentioned it on the wordpress.org/support page.
side note: Is it possible to be able to select the dashboard modules specifically for a user level? It seems that what ever is seen on my dashboard is also seen on all users.
User levels are obsolete and wouldn’t work this way, but you could use user capabilities. For example, if you put “edit_plugins” in the “Access level” field for a menu item, only user with that capability will be able to see/access that menu.
I am having some trouble with the user permissions. The plugin is letting me block access for certain parts of the admin but not others.
I am simply adding edit_plugins to the access field of any area that I dont want the user to be able to access. For some reason it is not working for tools and users and possibly others.
NVM, I just realized I need to block the sub menus also.
Now I just have to figure out how to have only EITHER the “users” or the “profile” menu visible. I dont want both to be visible to the user. The problem is the “profile” menu is not in the list of main menu items.
Thanks for the help and a great plugin. I hope to use it to make a custom admin page eventually.
alright I think I have the fix to removing the users menu without interrupting the profile menu. I just removed the profile.php from the profile submenu, and created a new custom main menu and added the profile.php file to that.
For some reason the profile.php file returned to the original profile menu and the access feild went back to read, but it does appear to be working.
Thanks again for a great plugin, this looks like it could take the place of the roles plugin when that becomes obsolete.
I’m glad to hear you got it working.
Regarding the “Users” and “Profile” menus, WordPress automatically adds or reconfigures them depending on the logged-in user. This is a special case that isn’t handled by the plugin, so you could end up with both menus at the same time when using it.
I could probably fix it with some inelegant hack, but I’m lazy
Ya it is a bit hacky as your description says. You can get the users menu to disappear if you change the file and access for my profile under the users menu.
The hacky part is that when you make another change the change you made to the my profile goes back to normal. So whenever you make a change you have to remember to go back and change the my profile.
I am also having a similar issue with an email plugin that I want to restrict certain areas. All in all I cant complain tho. As long as it gets the job done that is all that counts.
With this plugin I was able to hide a few menus and make my admin much less intimidating to users.
Now I just have to figure out how to make a solid custom menu, which hopefully wont give me any trouble.
Hi, i get this error when trying to activate your plugin.
Fatal error: Class ‘ReflectionClass’ not found in /home/wp/public_html/wordpress/wp-content/plugins/menu-editor/shadow_plugin_framework.php on line 101
Im using WP 2.7.1 and I have PHP 5.2+, i have tried deactivating all my other plugins.
Any idea what could be wrong?
The PHP documentation claims that the reflection API is included in PHP 5 by default, so either it’s been somehow turned off in your PHP configuration (I don’t know if that’s even possible), or you’re not really using PHP 5. Those arep retty much the only causes I can think of.
Would you be willing to write up a quick tutorial on how to use your plugin to create a top level menu page?
I gave it a shot but couldn’t make it happen.
thanks, MIke
What exactly is the problem? I just use the “New” button to add a custom top menu, save, add a few menu items to the new menu, and it seems to work.
I am looking to add a new php file to the menu. It just needs to have a link with a popout so the php file will be pretty simple. I just cant figure out what exactly needs to be in the php file.
I have been trying to get my head around this http://codex.wordpress.org/Adding_Administration_Menus
I have tried a few things but cant seem to get it to work.
Maybe your plugin is not intended to work in this way…
I’m still not quite sure what you’re trying to accomplish. Do you want the menu/submenu to point to an URL outside the Dashboard? That would be impossible without writing some kind of custom redirector script or hacking the WP core, as the script that outputs menus would always mangle the external link otherwise. However, a relative URL like “/stuff/foo/bar.php” might work.
Or maybe I’ve misunderstood your comment and what you actually want is to write a new plugin.
I am just trying to add a basic menu, when the user clicks on the menu item, it will bring them to the menu page that I have created. Inside that menu page will be a link, maybe that is where you were confused. I am not trying to redirect the menu to an outside page.
I tried writing a basic plugin to handle this, but was unsuccessful. I guess I am not sure what needs to be included, the only part I do know is what will be echoed onto the page(some text with a simple popout link)
Allright, how about this super-simple plugin :
It adds a top-level menu and then adds a submenu entry to that new menu. Requires PHP 5 (because I’m lazy) and should work in at least WP 2.5 and up.
Best plugin ever! Thanks for your hard work.
Hey, thanks for doing that for me.
Like Bryan says, this plugin is great.
One of the biggest grey areas for wordpress modification is modifying the dashboard.
Thanks again.
HI about the Reflection error, I got some sort of wierd PHP version called 5.2.6RC4-pl0-gentoo. Maybe the reflection class isnt included in that version. Im trying to get the admin to update PHP but if he wont, is there any possibility to work around this problem??
In principle, it is possible to rewrite the plugin so that it doesn’t require the reflection API, but that would take some careful editing. I’d prefer to explore other possibilities first.
Hey its me again, back to bother you some more.
I finally finished up on the site that I want to link to from the admin, however when I went to change the permissions for your plugin above it gave me an error.
The page displays for the admin but not for other users. I am wondering if it has to do with the array in there, which makes it not act like http://codex.wordpress.org/Adding_Administration_Menus.
Hopefully its a simple change and not a trip back to the drawing board.
THANKS.
Yes, the example plugin above is set to display the menus only for admin users (and it has nothing to do with the arrays; the arrays are how you pass an object’s method as a user-defined callback… if that makes sense).
To allow other users to see them, you’ll need to change the capability parameter (currently set to “manage_options”) in the lines that call add_menu_page() and add_submenu_page(). See Roles and Capabilities for a list of capabilities.
For example, if you replace ‘manage_options’ with ‘read’ then any logged-in user will see the menu.
I should have known that. I tried using the capability instead of the role number, but for some reason I dident remove the manage_options.
Thanks for helping with this, I hope this helps others with adding a custom menu.
Apparently the Reflection class wasnt included in my version of PHP. But now it is and everything is working! Great stuff!
I am back for more. I am trying to add the custom icon to our custom admin page, yes I am a perfectionist, and yes sometimes I wonder if I will ever understand php. I have tried so many different things to no avail. Maybe someday it will click.
By the way nice post on the mozilla addons. I like the autopager.
Well, the documentation says you can simply add the icon URL as the last parameter when calling add_menu_page, e.g. :
I imagine you could use a relative URL there, like “/wp-content/plugins/myplugin/icon.png” (though hardcoding the path isn’t always a good idea).
I tried that approach with /images/icon.png and public_html/images/icon.png
I then get this error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/aquacult/public_html/wp-content/plugins/exchangemenu.php on line 30
this is officially my code:
add_menu_page(‘Example Menu’, ‘Jobs Aquatic’, ‘read’,
‘example_top_menu’, array(&$this, ‘page_example_top_menu’)'public_html/images/icon.png’);
You dont have to bother with this as it is not really necessary, but when I try and do something and I cant make it happen it tends to make me want to conquer and defeat the problem.
It looks like you’re missing a comma before the icon URL. And I think you don’t need the “public_html” bit.
Right on, that reminds me of what I read about php someplace. “Commas and semi-colons can be your worst enemy.”
Also when I was trying this I was putting the full image url. That is the way a few of the other plugins I use work.
Anyway thsi is what it should look like:
add_menu_page(‘Example Menu’, ‘Jobs Aquatic’, ‘read’,
‘example_top_menu’, array(&$this, ‘page_example_top_menu’),’/images/icon.png’)
Thanks for helping out with the custom wordpress admin menu.
Hello,
your plugin is very useful, but if I set different access level for a top level menu, the menu is still visible to users who don’t have that capability.
Here is the function (simplified) which deals with capabilities:
http://wordpress.pastebin.ca/1389987
The problem is that it only filters submenus and leaves menus intact.
Sorry, this is the working version: http://wordpress.pastebin.ca/1389993
I seem to hazily remember that there was some specific reason for not filtering out top-level menus, but I don’t recall what it was. Anyway, if you also set the different access level for the submenus, WP should hide the top-level menu as it will have no visible submenus.
Ok, I guess that’s a solution.
BTW, have you considered submitting this plugin to wordpress.org so that we can get automatic updates?
Yes, but I’m very lazy in this respect
Anyway to make this work with PHP4?
One could try, but it would take a lot of rewriting.
You’d need to set all hooks manually – the “magic” self-installing hooks of my makeshift plugin framework depend on the Reflection API, which is PHP5-specific. Class constructions would need to be renamed. Some variable initializers might not work in PHP 4 (arrays?). There’s probably a foreach() loop or two that use the iterator by reference (also not supported in PHP4). And so on.
Thanks for this great plugin! I looked for ages to find something to simplify the administration menus for my clients. Good work!
Well, it does just what I need – great plug! Thanks a lot
First, thanks for what is a really useful plugin.
Second, the problem [you just knew there had to /be/ a problem
]: not sure if this comes about from trying to do too much with ME, or as a result of an interaction with other plugins. It _only_ happens on one site where there are some 20 or so plugins installed [it's a very complex "private" members-only site]
Problem Description: open menu editor from Settings menu, go to “settings” sub-menu, sort all plugins [not default WP items] into alphabetical order below the default WP elements. Save. Refresh page. Go to Settings menu: Menu Editor itself has vanished from the Settings menu and one or more other plugins may also have vanished, whilst one or more plugins may be duplicated in the Settings at odd non-alphabetical places in that settings menu. Duplicate items _are_ functional.
Go back to Menu Editor via the installed plugins page or via direct URL and ME shows everything correctly as last saved: not as shown on the settings menu.
Clearing the WP Cache makes no difference. Clearing the browser cache makes no difference. Indeed the problem is visible from different machines on different OSs and using several different browsers etc etc.
Reset menus to default order, save and refresh and everything instantly works as expected.
Have tried deactivating Menu Editor, cleaning out the options table and then reactivating, but the problem reappears fairly quickly once one starts sorting entries.
I’ve not yet had the courage to deactivate all other plugins and/or reset the WP options table to defaults in order to do a ‘clean’ test because this is such a complex site.
NB: this problem does _not_ arise on other less complex sites running on the same configuration of Apache/Linux with PHP5.n and MySQL5.n and WP 2.7.1 [they're all virtual hosts on the same physical box], although many of them do share several of the same plugins.
Having to run with default order in the Settings menu isn’t a major issue, but missing and/or duplicate items could become a problem. Most of all it’s an irritant which is puzzling me.
Any thoughts or suggestions?
Yep, this might really be a compatibility issue. So muster up the courage and test that idea
– First, save the sorted configuration. Then deactivate/reactivate your other plugins one by one. Reload the page aftear each deactivated plugin and see if the menu is OK. That should help you find the conflicting one.
Personally, I’m pretty sure it is a plugin conflict. Sorting works fine even in WP 2.8 beta, though there are some glitches with separators.
Hi, with the purpose to check plugin compatibility behaviour with 2.0, I duplicated my WordPress site and upgraded. Strangely all my settings in the Menu Editor were resetted to default.
Tha means I should go and re-arrange everything again after upgraded to 2.8. Is this normal? Anybody else met the same issue? If yes, are there any fixes to this?
By the way, this is the bes plugin ever! Letting you customize your admin is someting that should be considered as a default option in any CMS. Luckly, White Shadow did a great work with this. Thanks.
For what it’s worth, upgrading to WP 2.8 worked fine for me – the settings were retained and the plugin still worked as expected. Perhaps in your case the settings were actually lost in the duplication process?
I got a question.
I finished the development for a site (on local) and now I need to put it on the live server. Even without upgrading to 2.8, whenever I copy all my files to the server and I import the databse, the Menu Editor plugin doesn’t keep its settings I set up on local.
Well, actually, I even made a test from local to local (copy files + export/import databse) and I got the same result.
I got the default admin menus and I need to re-arrange them all with Menu Editor again. Is there a reason why that happens. Is it a normal behaviour or a bug?
You say, “perhaps in your case the settings were actually lost in the duplication process?”. How is that possible? Where and what should I look to see where the problem might be?
Thanks for letting me know.
All settings pertaining to this plugin are stored in the “ws_menu_editor” option. Options are, in turn, saved in the wp_options table in the WordPress DB. You can view the database with something like phpMyAdmin (or whatever other tool your host has).
You could check the “ws_menu_editor” option before and after copying, and try to figure out when/why it changes or gets deleted.
One can view the stored options without the use of phpMyAdmin or the MySQL Administrator Toolkit.
http://my_site_url/wp-admin/options.php
It’s not guaranteed to be true but it’s my observation that where other plugins are using the now deprecated get_settings call in their coding, instead of the get_options call, such plugins will interfere with the correct deployment of menu editor.
I’ve seen exactly the behaviour you describe. The only way I’ve found to force menu editor to behave correctly thereafter is to export all WP content, de-activate all plugins, drop and then recreate the DB tables and then reimport the WP content and re-activate ONLY the menu editor plugin and set it as one wishes it to behave. Once that’s been done one can reactivate the other plugins one at a time until one finds which plugin or combination of plugins causes the menu editor to stop functioning. At that point it’s a case of hacking through the code of the problem plugin and replacing any get_settings calls.
Could you name at least one of the problematic plugins? I’d like to test those plugins myself and, if possible, make the menu editor coexist peacefully with them. Right now I just don’t see how
get_settingscould be a problem, because internally it’s just a wrapper forget_option(at least in newer versions of WordPress).I may have expressed myself badly; as far as I can tell it’s not your code that’s the problem, it’s the code in the other plugins that’s the problem.
For example using the WP CMS Post Control plugin in conjunction with SarahG’s Page Menu Editor and OZH Admin Drop Down Menu seems quite frequently to cause problems for ME, especially if a] there are a lot of plugins and b] during the process of site development one is adding and then removing and then re-adding various plugins for testing purposes to discover which combinations of plugin do work together in a friendly manner.
One of the issues I’ve noted with some dismay is that not all plugin authors use a sensible cleanup option when their plugin is deactivated; in other words they leave their junk behind in the options table when the plugin is deactivated. What a well-behaved plugin _should_ do on deactivation is offer to export the current settings to a suitable file in the plugin directory, and then remove all of its current settings: if one then reactivates the plugin one should then be able to import the old settings. As we all know, over time the WP options table can get very messy. Yes I know there are plugins to inspect and clean the options table, but that’s beside the point: by and large with well-designed plugins one should not have to go cleaning out the options in the first place.
In my case, one of the common things I’ve found is that at a certain point, having added/removed and possibly re-added various plugins ME simply will not show on the menus one or more plugin items that are actively installed and functional and there’s no way back from that except to drop the WP tables, recreate and reinstall the plugins. Cleaning out the options table doesn’t help.
Right now I have one site in development which has the Upload+ plugin installed, [together with quite a few other plugins] but Upload+ isn’t showing up in ME or on any of the admin menus. Clearing the WP and browser caches isn’t going to change that visibility issue.
I see. I’ll test some of the plugins you mentioned later.
However, I disagree with the idea that a plugin should clean up it’s options/database records when it is deactivated. There are lots of situations where plugins are deactivated only temporarily, like when upgrading the plugin or updating the WordPress core itself. It would be impractical to make the user explicitly import the old settings every time.
Instead, I think plugins should clean up when they’re uninstalled, which is both more intuitive and easier to implement. WP 2.7 even introduced an uninstallation API, though most plugin authors still haven’t updated their plugins to make use of it (I’m quite guilty of this myself).
That is, if you’ll forgive me, a semantic argument rather than a real or meaningful argument; deactivating and uninstalling are functionally the same thing as far as both the site administrator and users are concerned. Deactivate a plugin and the users will be deprived of its benefits – whatever they are; wordpress performs exactly as if the plugin is uninstalled.
Yes we all of us have to deactivate [some] plugins during the course of upgrades etc, or for other temporary reasons; but the fact remains that too many plugins habitually leave dross in the options table and elsewhere after an uninstall. This is simply bad coding. Just as hardly any plugins allow one to view or export ALL of their current settings.
Giving the admin the *option* to export/delete settings before deactivating is the key to what I said: which you elected to ignore.
The new uninstall API is good, as far as it goes.
I’ll concede that having an option to export/import a plugin’s settings would be a useful feature, yet I must insist that deactivating and uninstalling a plugin are two distinct actions. And, judging from how the uninstall API works, the people working on the WordPress core would agree with that.
Of course uninstalling and deactivating are two distinct “actions” on the part of the admin – I’ve not said otherwise.
However *functionally* as far as the use and deployment of WP is concerned they’re identical: there is absolutely no difference between a WP site with a deactivated plugin and the same WP site where the plugin has been entirely uninstalled through the WP UI, or indeed a WP site where one simply deletes the relevant plugin directory in the file system.
All of these methods produce identical functional results.
Take a common addon: TinyMCE Advanced; deactivate it and the *effect* for all users is exactly the same as uninstalling it, and vice versa.
The WP Uninstall API is irrelevant in this context: it’s merely a cleaner more logical means for achieving those functional changes.
It seems to me that you’re far more of my comments than they warrant.
@ Robert Neuschul:
As it is best practice, to deactivate plugins before doing an update on WP, there’s a big logical difference between uninstalling and deactivating. And I wouldn’t want to import all my settings after a (maybe even minor) update on all the sites i’m working for.
Therefore the uninstall API is highly relevant and i wish more plugin authors would use it.
If you updated your blog to 2.8 with plugins left active, you probably ran into severe problems.
@ m.e
Logical and functional aren’t the same thing: I wasn’t discussing the logical or even the best practice: I was describing the functional EFFECTS of two different actions.
If you disagree with my statement that uninstall and deactivation are functionally equivalent then show me a single instance where uninstall and deactivation have different functional effects on the ongoing operation of a WP site as far as either users or sysadmin are concerned.
As for the u/g to 2.8: for some values of “severe problems” you’re correct. If plugins are already 2.8 compatible then deactivation is not required. Best practice tells one to deactivate; and it is indeed a good idea in almost all instances, but if a specific plugin is already and genuinely 2.8 compatible then it isn’t essential.
However the issues surrounding the uninstall API still are not relevant to a description or discussion of functional effects until one comes to a discussion of reinstallation or reactivation of a plugin.
Again: you’re making the same mistake as White Shadow: making more of my comments than they warrant.
This does not appear to work, at least with wp v 2.8 and my collection of plugins. I’ve tried from FF and Safari (Mac) and the menu does not seem to permit cut/copy/paste, or drag/drop. Is there a place I can report the issue more fully? Can I assist by providing more information?
Thanks.
I suspect it’s a plugin conflict of some kind. I’ve tested the menu editor in a relatively “clean” install of WP 2.8 (using FF and Opera) and drag & drop and the menu items still work as expected.
The quickest way to test if it really is a plugin conflict is to temporarily deactivate all other plugins (this should be pretty easy to do via the “Bulk Actions” dropdown.) and try using the menu editor again. If you find out the editor works with other plugins deactivated, re-activate your other plugins one-by-one to find the conflicting one.
You could also check the Error Console in Firefox for some clues (Tools -> Error Console).
[...] Admin Menu Editor – used to hide menus from my client’s user account and “keep things simple” [...]
Hi,
I accidently set my “Settings” menu to invisible with Menu Editor – now I can’t access it via the direct URL lnik, it says I don’t have enough user rights. How can I access Menu Editor now to make “Settings” visible again?? Wehre in the DB can this be done?
Thanks!!
Go to the wp_options table and delete the row that has the “option_name” column set to “ws_menu_editor”. This will reset the menu configuration and let you access the “Settings” page again. Note that any other changes you made to the dashboard menus will also be lost.
LOVE U! <3
[...] In: WordPress plugins 13 Aug 2009 Go to Source [...]
Hello,
I am trying to add a new seperator so I copy and paste an existing one but when I save it disappears. Any ideas how to stop this?
Thanks
Dave.
Strange, I’m not seeing that behaviour in my test setup. Have you tried moving the copied separator to a different place before saving? Maybe you could instead copy a normal menu and then change it’s properties so that it becomes a separator (as a workaround).
Hi,
I don’t understand my problem. I configure my dashboard menu with your plugin. And all is ok. But when, for example, I change the theme of my website, the submenu of the previous theme is always present and it isn’t hidden (And when, i click on this link,of course, I have an error like “The requested URL /htmlv3/wordpress/wp-admin/fusion-settings was not found on this server.”
Can you help me please?
This is a known issue. The plugin errs on the side of caution and doesn’t automatically remove menu items that point to a non-existent page.
I’ll put this on my to-do list, but I can’t promise it will get fixed soon – there are other things that take priority right now.
Just FYI – I love this plugin, but now it has a conflict with Disqus that renders this plugin completely unconfigurable while Disqus is activated. When I deactivate Disqus, I can change the settings on Menu Editor, and thank goodness they seem to stick even when I re-activate Disqus. My guess is that it happened with the latest Disqus update and is a javascript conflict.
Hmm, I installed Disqus in my test blog and the menu editor still worked fine… So I’ve got no idea what the conflict might be.
Assuming it really is a JS conflict, check your browser’s error console for the specific error message.
Benjamin Allison, I am also running a WPMU website.
The Site Admin menu seems to be getting added to every blogs admin area.
Although users cannot access the pages on it.
Are you finding this too? Were you able to overcome it?
I am looking for a similar plugin, I rememebr having seen it somewhere, where one could specify what menus are available for what users/roles/etc…
i.e. excluding the TAGS menu for everyone, etc…
Hi,
I have noticed that the Admin Menu Editor plugin does not work when the WPML plugin (http://wpml.org) is activated also. (WP 2.8.4)
Once WPML activated, if I go to the Menu Editor option in the admin, I cannot drag the items around or click any option. It seems to be a JS issue. It gives the error “menu.defaults is undefined” in menu-editor.js line 110.
Other users seem to have the “menu.defaults is undefined” error issue. Is there any solution to this ?
I don’t have a solution as of yet. The problem is I can’t replicate the bug – when I activate WPML the menu editor continues to work without a hitch.
[...] önskade innehållstyper är skapade installerar du pluginet Admin Menu Editor som ger dig fria händer att möblera om (och dölja saker) i [...]
Someone emailed me about how they solved the “menu.defaults is undefined” problem; I’m posting their comment here (with permission) as it might help other users :
[...] Admin Menu Editor Permet de personnaliser les éléments du menu et de ses sous-menus d’administration. [...]
White Shadow, this might have been asked already before, but is there a reason why this AMAZING plugin of yours is not listed in the official WP plugin repository?
It’d be nice to get noticed about updates and stuff. Plus, I am sure you’re cutting off quiet a big piece of potential new users by not having it listed in there, and that will never find out such a useful plugin. To me Menu Editor is a must-have for each and every WP installation.
It’s mainly due to my laziness. Nevertheless, listing in in the wp.org repository is on my Cthulhu-forsaken to-do list.
Just do it, man! The plugin deserves it. Your work deserverves it!
(When my blog’s up, I’ll write a review on Menu Editor).
Any chance you added this plugin to the WP.org repository ?
Also is there a way to change visibility to menus by user-roles ?
Oh very well. It’ll be up on wordpress.org in a few days (provided they process the inclusion request quickly).
There’s no way to change visibility by role yet, maybe someday.
YEEEEEEEEEEEEEEEEEEEEEEEEEEESSSSSS!
It’s alive!
You will probably need to (re)install it from the link above to make the automated updating feature work. This is because the directory name has changed.
Hi, this plugin don’t work in WP 2.9. Please help. Thank you.
Could you elaborate? I’ve used it with WP 2.9 and it seemed to work fine.
getting this error
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home4/plugins/admin-menu-editor/menu-editor-core.php on line 13
It seems your server has an older version of PHP. This plugin requires PHP 5 or later.
damnit
Hi, I’d just like to say that this is incredibly useful for setting up non-technical people with the ability to post and edit content. Thank you for giving this a try!
If you keep having difficulties with coding, please consider focusing on how we can provide views for basic functions like editing, categorizing, comments, and the like? These are the things that we need to provide for non-technical people, and since they’re the proverbial bulk of the iceberg, any help we can get is – really helpful
This looks great i ahve installed it but am a bit baffled by all the options, are there any instructions or a manual for this plugin?
Not really. But if you need help with anything specific, feel free to ask.
Just wanted to say a massive thank you for this plug-in.
I’ve been after this functionality ever since I started using WP.
Cheers!!
>>>> “Not really. But if you need help with anything specific, feel free to ask.”
I don’t quite understand the ‘file’, ‘access level’, ‘theme’, ‘page title’ and ‘icon’ options.
Most importantly i’d like to remove certain menus for certain users, is this possible?
Which CSS file would i use to style each menu?
Thanks!
File identifies the page that will be opened when you click the menu. It can be an actual file or relative URL – like “index.php” for the front page of the Dashboard – or a plugin page ID – like “menu_editor” for this same plugin. When the menu is displayed, WordPress will automatically generate the actual URL for the plugin page. Typically, a plugin page URL looks like this – “main-menu-file.php?page=plugin_page_id”.
Access level determines who can see/access the menu item. Only users who have the “capability” set in the Access level field will be able to use that menu. See the in-depth discussion of user capabilities for details.
There is no “theme” field in the menu editor. I’ll assume you were referring to the CSS fields.
CSS class is the CSS class of the link that represents that particular menu item. It’s probably best to leave this one alone.
CSS ID is the ID of the list item that represents that particular menu item (in terms of HTML, the menu is rendered as an unsorted list). You could use this ID in the /wp-admin/css/wp-admin.css stylesheet to alter the look of the menu item.
Page title is just what it sounds like. It’s what you’ll see in your browsers title bar when you click on the menu in question. This allows you to have different captions for the menu itself and for the page it leads to. Useful if the full page title is too long to fit in the menu without looking broken up.
Icon is an internal WP setting that indicates what icon the top-level menu will have. I would advise not messing with this one.
Awesome, thanks man. No idea where i got ‘themes’ from….
Would i add styles to ‘wp-admin.css’ ?
I think that would work, though there probably is a separate plugin for this kind of thing.
A GEM, Janis! Got rid of ALL my other plugins that make the site “look” like a CMS especially on the administrators and editors menus. A little understanding of WordPress’ internals and your module replaced them all (ie, overhead). Awesome! Thanks for your time and efforts in sharing this with the open-source community.
You’re welcome
Thank you for creating this great plugin. What would I have to do to use it in WPMU to create sitewide menu items for all blogs?
Frankly, I don’t have the faintest idea. I’ll check the WP docs, but I doubt making a sitewide menu will be easy.
Great Plugin idea. Would this make it possible to change the text on the “current theme options” tab under Appearance?
I haven’t tried that, but I believe it would.
Amigo. I emailed you via the contact link on your website but I thought I’d post here too. This plugin is perfect and exactly what I need. I need it however for a wpmu install and need it to modify admin menus across all blog owners (same menu setup for all except for the wpmu admin who will have full admin menu). I don’t even know if it’s possible (it likely is because I found a modded version of adminimize to work with MU).
Please contact me to discuss, am willing to pay for dev.
Thanks!
Aye, I got your email. It’s probably doable, but I need to research how WPMU handles the plugins & menus before I can say for sure. I’ll reply via email when I’ve looked into that.
Thank you for creating this great plugin.
me too ! I need it however for a wpmu install and need it to modify admin menus across all blog owners . plz plz !
Actually, I’ve already implemented WPMU compatibility – I just need to update the readme.txt and other docs before I release the new version. It should be out sometime this week
yessssssss . thank you
That really a great plugin, should go to core
Could you better explain “parent file in the ‘File’ field”? A detailed exemple would be nice!
Here’s an example : Say you want to move a plugin’s page from the “Settings” menu to the “Tools” menu. If you look at the “Settings” menu in the editor, you will see that its file field is set to “options-general.php”. This is the “parent file”. After you cuty & paste the plugin’s menu entry to the “Tools” menu, you will need to edit its “File” field to say “options-general.php?page=my_plugin” (replace “my_plugin” with whatever value was in the plugin page’s “File” field originally).
I’ve looked into automating this, but the internal menu structure that WP uses is so messy that it’s not really practical.
hi
How can I reset all settings?
I did a few mistakes in edit menus and now menu editor page Is not fully loaded … Please see the picture :
http://i.imgur.com/8sWNG.jpg
::: reset default menu button and reset menu button and other buttons do not work too
You can reset the settings by deactivating the plugin, then uninstalling it using the appropriate “Delete” link in the “Plugins” tab. This will remove the plugin’s settings.
That said, the plugin really shouldn’t have stopped working just because you made a mistake while editing a menu; it’s probably a bug. If you could check your browser’s error console (FF – Tools -> Error Console, IE – double-click the exclamation icon in the status bar) for any JavaScript-related error messages that might show inthe editor’s tab, I might be able to fix it.
I use this plugin for MU and I can’t use delet link
I removed it from my server and upload it again. But the settings did not reset.
and error :
in FF :
Error: entry.defaults is undefined
Source File: http://…/wp-content/mu-plugins/admin-menu-editor/menu-editor.js?ver=2.8.3
Line: 184
in IE:
Message: ‘defaults’ is null or not an object
Line: 182
Char: 2
Code: 0
URI: http://…/wp-content/mu-plugins/admin-menu-editor/menu-editor.js?ver=2.8.3
In that case, you need to manually delete the “ws_menu_editor” option from your wp_options table.
I’ll see what I can do about that error.
Err, I mean the wp_sitemeta table.
thank you very much !
This plugin is amazing.. If I were to make changes to menus will it maintained after updates of WP?
Also, If I am going to create new admin views is it better to duplicate an existing and then make the changes or just make the changes on the original?
Not exaclty sure how the WP updates impact my changes/ additions.
How do I make menu’s to be user level specific?
thanks again!
In general, your changes should be retained when you update WP. With the obvious exception that if the new WP version removes a menu then that menu will no longer work even if you still have it in the custom menu structure.
User levels are deprecated. I would recommend using capabilities instead. For example, you can make a menu item be only visible to administrators by entering “manage_options” in the “Access level” field.
Hi!
Your plugin is just simply amazing!.
I have the same problem as Elia (173). How can I reset plugin settings? I deleted the plugin files from Wp-content and uploaded again, but settings still are the same. I can’t see the Options menu to acces the plugin. Thanks.
See my responses to Elia, then.
In short:
* WP : Delete the plugin via the Delete link in the Plugins tab. Manually removing it from /wp-content/ will not help.
* WPMU : Delete ws_menu_editor from wp_sitemeta.
Absolutely one of the best plugins available for wordpress. Totally invaluable, thank you very much!
This is a *great* plugin, but I have a problem. I am running a wpmu installation. I want to edit the menus and have all sites show what I set. Right now, I am logging into each site backend, making changes, then making the menu editor link not visible. Is there a way to make global changes to the admin menu?
Have you installed it in /mu-plugins/ (and according to the instructions in readme.txt)? That should allow you to edit the menu for all blogs at once.
sorry, I should have read the readme.txt
I had installed it like a regular plugin and activated it sitewide.
Thanks for your help – it works perfect! This plugin is a major help to those running wpmu!
I hid the whole menu and now I can’t get it back. I deleted the whole plugin from mu-plugin but when I upload a fresh plugin it hides it again automatically. I think I must manually uninstall it but how do i that without the menu?
Delete “ws_menu_editor” from the wp_sitemeta table.
Thanks bro, and thanks for getting back so quickly. Just threw ya a few bucks. Excellent mod.
Im having this problem:
http://wordpress.org/support/topic/165717?replies=5
Which is solved deactivating the Admin Menu Editor.
I’ dont’t know if it’s because white spaces, utf-8 ascii or what… :S
The plug-in is great!!! Unfortunately I can’t use it on my blog now…
Hmm, if that thread is anything to go by, the real cause of the problem is probably either WP itself or a botched plugin install/upgrade. It seems very unlikely that half a dozen wildly different plugins would all cause the same mysterious bug (and only on specific blogs).
I’m having trouble with access levels. I tried “10″, but no matter what blow owners are able to see the whole menu. How do you change it so that blog owners can’t see a menu item but the site administrator is the only one who can see it?
Ok, it seems I can’t change the access levels for any of the default menu items. I’m using “10″ and “edit_plugins” in the access field, and I also changed the users to editors and it still shows up. Is there any way to do that using this plugin?
AFAIK, this is a limitation of the WordPress capability system – there is no capability or access level that is specific to the site administrator. Both site admins and blog admins are treated as equal, capability-wise.
If you don’t want the blog owners to see a particular menu item, try placing it in the “Site Admin” menu.
[...] Plugin on WordPress.org Plugin Homepage [...]
Wow. I have to say this might be the best plugin I’ve ever downloaded. You should contribute this to the WP core! This is an absolutely invaluable tool for running WordPress as a CMS!
Thank you so much for this plugin! I hope that you can help me with a weird thing that’s happening when I create a new/custom menu.
I can cut/paste items from other menus into the custom menu, but the custom menu displays oddly. The menu name doesn’t show up, and the items on the menu only go about half way across (then wrap).
When it’s above another menu, it overlaps. When it’s by itself at the bottom, it of course doesn’t overlap, but it’s easier to see the “half width” display.
I’ve viewed it using Firefox and IE6 (at work) and it still looks the same. I’ve deactivated all my plugins and reactivated ME and it still looks the same. I switched to the default theme, and still the same weird menu display. Any idea what this is?
Thanks again!
Hmm, I’ve never seen anything like that. How about a screenshot?
Also, what are the CSS class and CSS id of that menu set to? For reference, the defaults are “menu-top” for CSS class and “custom_menu_1″ for CSS ID.
Thanks for getting back to me.
Here’s the screenshot: http://www.ripplesofimprovement.com/articles/menu-editor-screen-shot/
As for the CSS class and CSS id of the menu, I didn’t change them. The CSS class is listed as: wp-menu-separator-last
And the CSS id box is empty.
Is that the problem? Should I change them to “menu-top” and “custom_menu_1″?
Thanks!
Cathy
Well, heck! Whatya know? I did change them and suddenly it works now. I don’t know why they said something else. I know I didn’t change them deliberately.
Cool! I’m off to add more to the menu. Thanks again!
Umm…dumb question…can you only add 2 custom menus? Whenever I try to add a 3rd, it replaces the 2nd.
You’ll need to change the “File” field of the additional menus so that it has a unique value for each menu. It doesn’t matter what exactly you enter in it; something like “custom_menu_xyz” or “my_cool_menu” would work fine.
And yes, this is a bug. The plugin should be doing this automatically.
[...] are more advanced plugins such as Admin Menu Editor which allow you to fully customise the menu of WordPress. I have tried Admin Menu Editor and [...]
Hi WS,
All I read is good words about your very useful plugin. It sounds great and looks very elegant as well.
At the moment I am using “adminimize”. This gives me great control over everything. Still, I cannot (as the person who set up the blog) give limited access to the blog administrators (clients). They insist of being administrators and cannot deny them. So we ALL are administrators and I am always scared of them making a booboo and mess the whole blog up.
So I was just wondering… Is it possible to add an option to your plugin for the person who set up the blog (me here) to be able to limit rights to only administrators by user id?
Furthermore, if I am to use both Adminimize and Admin Menu Editor side by side, would I get any conflicts? Have you had any tests (????) done?
Thanx in advance. Marikamitsos
Love the plug in! it was working great then one day I decided to go in and hide another menu item an BAM I was hit with this “You do not have sufficient permissions to access this page.” any idea why?
@marikamitsos : I’ll note that down as a possible feature to add in a future release.
I know that at least one user has used Adminize and Admin Menu Editor side by side and they didn’t encounter any conflicts.
@John : Have you edited or moved around the “Menu Editor” menu item itself? That could cause this kind of problem. If that’s the case, you’ll need to reset the menu by deactivating and uninstalling the plugin.
Hi White Shadow. This plugin rocks. I have one question that you may have already answered (although I read through all 7 pages of the comments section and didn’t find any info).
You wrote in the plugin instructions page:
“Note that if you move an item that belongs to a plugin, you will need to modify the “File” attribute to point to the right parent file (e.g. instead of “akismet-key-config” use “options-general.php?page=akismet-key-config”).”
I’m trying to move all my plugin menus to a custom menu I created (Plugin Settings), but I can not figure out how to rewrite the paths for each one in the File field. Does it have to be the absolute path to the location of the main plugin php file? No matter what I do, I end up with a “You do not have sufficient permissions to access this page” message every time I click on the plugin menus that were moved. I get the same message if I click on the parent custom menu.
I know I’m probably missing something that is very basic, but if you could help me figure out what it is exactly, I would really appreciate it.
Congrats on developing this plugin and on the wonderful and constant support that you provide.
In general, plugin-created pages have URLs like this :
http://yoursite.com/wp-admin/parent.php?page=page_id
If you simply move a plugin menu, it will only have the “page_id” bit in the “File” field, and it won’t work. What you need to do is go to the plugin’s page, copy the part of the address bar URL that corresponds to the bolded fragment above, and put it in the “File” box for the moved menu.
For example: I have my Broken Link Checker plugin running on this site. The URL of its settings page is :
http://w-shadow.com/wp-admin/options-general.php?page=link-checker-settings
If I were to move that page to a different menu, I would need to put this in the “File” field of the moved menu :
options-general.php?page=link-checker-settings
I hope that helps.
Hello again, WS. First of all, thank you for getting back to me so quickly about this, specially on a Sunday.
After your explanation, I was able to understand the moving mechanism way better, and I was able to get the Add This plugin working well after moving it inside my custom menu, so thank you very much for all your help!
Hey WS!
First of all as it’s been said before, what a tremendous plugin this is. Truly superb work.
I’m running it as a site admin on a wpmu 2.9.2 install. I’ve been able to move directories and subdirectories all over the place even renaming them to best suit my users needs.
I have noticed that if I make any changes to the “General Settings” tab (options-general.php) that when I click save I am taken to the dashboard and the Menu Editor no longer works. Clearing the SQL table resets everything and I try again.
What I’m trying to do is make the General Settings tab appear as a submenu of the Dashboard at the top. I’ve tried copying it and placing it up there. I’ve also tried cutting and pasting it. I’ve clicked the “custom” button and even added the link to the “File” field. I’ve successfully moved everything else around to their new homes, but when I try to do anything with this one the plugin breaks.
Any thoughts? Again, such fantastic work at such a relatively early stage of dev is amazing! Koodos to you!
Short answer: This can’t be fixed except by throwing out the current WP menu subsystem and writing a new one. And I’m definitely not up for that, at least not without a significant monetary incentive.
I would recommend inserting the full URL of the original “General Options” tab in the “File” field of the moved menu. For example : http://example.com/wp-admin/options-general.php
I’ve tried it locally, and it worked.
Long answer: The dashboard menu system is, at its core, a horrible jumble of legacy code and undocumented hacks. It’s an eldritch horror, capricious and shrouded in mystery. It was never meant to be user-modifiable, and it shows. The arcane magicks that fuel Admin Menu Editor may be powerful, but even they can never fully control the beast. As you’ve discovered, one misstep, one unwritten rule accidentally broken, can render menus inaccessible.
Ahem. In summary : The menu system sucks, and programming for it is hard.
WS,
You sir, are the man. I give you +11 points for the reference to the dashboard menu system as “an eldritch horror, capricious and shrouded in mystery.” LOL that made my day!
Anyway, I see your point and if I had the funds to provide the significant monetary incentive, I’d probably fork it over. Alas, that time is not now. Should things change I’ll give you a call!
Great work man. Seriously.
Hi White Shadow!
This is an absolutely MUST HAVE plugin! Great, and THANKS for it!
A tiny problem I observed:
When I deploy my local site (single not mu install) to another host (and after when typically replacing the new host name in the database.. etc) on the new host the whole menu structure will be as default, although the database contains the right settings (in the quite magical json data) in the wp_option table option_name=ws_menu_editor.
I glanced at the concerning codes more times what may cause to vanish the previously set menu structure. But surely I’m not quite magical to understand what happens.
Could you help me – please how can I resolve this? (That’s a bit embarrassing to rearrange the menus as many times I may deploy my site to an other host, although the settings are kept in the database
much thanks for your answer
iplnts
So far I’ve been unable to reproduce the bug. I’ve tried moving a test blog to a new directory and a new subdomain (by following the instructions), but the modified menu was successfully retained in both cases.
Unfortunately, I don’t currently have a spare domain to test moving sites between domains. If you do, maybe you could give me access to such a moved blog that has this problem so that I can run some tests on the plugin?
Hi White Shadow!
Thanks for your answer, and help.
Unfortunately I can not give you an access to such a domain. I can only send you the database file to see the menu order is really well in that.
I wasn’t quite exact. (I’m using wp 2.9.2, and your last 0.2. version of your plugin downloaded from the wp plugin repository and my site allows multi author environment)
Actually, I didn’t move nowhere my site, only I wished to give access the site to an other computer on my local network for testing by an other people than me.
I mean, the test site basically remained on my localhost\wordpress directory on a computer named xy.
I only replaced in the previously exported wordpress.sql the localhost to xy as an exact domain name, then allowed accessing xy’s webserver on the other computer’s Win firewall, reimported that worpress.sql on xy, and changed that host name in the wp_config.php too. Restarted using the site from http://xy/wordpress instead of http://localhost/wordpress.
Generally, everything okay, I can see and handle the whole site from my xy an also from the other computer on the network except the previously set menu order lost on both computers.
Perhaps, I missed yet something in the settings (?)
As far as I glanced your code, and the core menu php too, I was unable to understand concretely that, how do you access the stored data in wp_option table option_name=ws_menu_editor? I couldn’t find any database operation. Only that line regarding to that for example in the menu-editor-core.php
//Set some plugin-specific options
$this->option_name = ‘ws_menu_editor’;
Have you any suggestion, what would be the error in this special case? How can resolve that?
)
(I’m a programmer but, not yet a wp expert or magician.
* I’m planning later after deliberately tested to deploy the site to a payed Internet host too. And I only should like avoiding to rearrange manually the menu again.
much thanks again for you answer
iplnts
Here’s some background about how the plugin works, maybe it’ll help you find the problem :
The options are loaded in the “load_options” method found in the “shadow_plugin_framework.php” file (around line 95). Once loaded, they’re stored in the “options” object var., i.e. $this->options. This variable is an associative array.
The custom menu is stored in the “custom_menu” key of that array. The custom menu is a pretty complex multi-level array. You can put a
call somewhere in the “hook_admin_menu” function in menu-editor-core.php to dump the raw custom menu structure to the screen.
The custom menu is used to modify the default WP menu on lines 131-138 of the menu-editor-core.php file.
My guess would be that for some inexplicable reason the plugin doesn’t “see” the old “ws_menu_editor” option once the domain name has changed. However, I have no idea how that could possibly happen.
Hi White Shadow,
Much thanks for your help, again.
That’s okay I found both functions to which you referred. I understand the logic. What I missed to realize that, how the options from the wp_otion table are (auto) loaded what is surely a wp core thing what I need to better learn yet.
Meanwhile, I had to rearrange the menu again, at now it resolved my problem. However, I exported this particular row from the database for the hope I could recover it somehow if the problem might happen again when I deployed the site to a final host.
BTW: There were defined yet in the wp-config – EMPTY_TRASH_DAYS, and WP_POST_REVISIONS by me which settings also had been by-passed after I’d run the site from the changed hostname, and I noticed later some else plugin settings also were lost too, unfortunately. (???)
In summary: This issue is surely not the problem of your plugin, but as a possible event, I wish you only to know about.
Much thanks again for your help, and further good works to you
iplnts
Hi White Shadow,
Let me react back to your previous message:
“.. My guess would be that for some inexplicable reason the plugin doesn’t “see” the old “ws_menu_editor” option once the domain name has changed. However, I have no idea how that could possibly happen…”
Perhaps, that I found explaining this may be useful for you too, if you haven’t figured out until.
——
I looked into a bit better, how the options might been loaded and found the trick to dump all options into the wp options screen:
(..domain/wordpress/wp-admin/options.php)
There I found quite many options variables are SERIALIZED..and disabled the writing out and any editing them. Although, when I’m seeing the database with PhpMyAdmin all of those variables previously set are stored in the database well, but after the simple manual replacing of the host name all of them will be lost.
I found some useful references what would be the problem:
1. http://www.andrewnacin.com/2010/04/18/wordpress-serializing-data/
2. http://www.davesgonemental.com/php-serialization-fix-for-wordpress-migrations/
As far as I can understand now, something happens with the serialized stored data when changing the domain name, thus those serialized stored data are hard to recover.
I’m not figured out yet how to get back them, but I will try in the latter (2.) suggested fix to run.
)
(It is truly a nightmare if I have to look trough every such option variable and set them again manually after deploying
cheer,
iplnts
Hi White Shadow
Yet another better fixer and explanation from browsing toward the above (2.) link
http://www.davesgonemental.com/mysql-database-search-replace-with-serialized-php/
Hey…
Just it is for me and I think everyone else who may has the same problem, and maybe some good trick also for you in the php code, perhaps
Interesting. Perhaps if I change the plugin to use a storage format that’s more tolerant towards manual editing these issues will go away…
Try this modified version.
No slight on the plugin, because I think it’s the most innovative WP plugin I’ve seen in a very long time, but if you could fix this issue, all my problems would be solved. Regardless, it is minor when considering how much this plugin does for WP backend!
Hi White Shadow
Much thanks dealing with my issue. I’ll try your modified version.
It is no doubt (I agree with Johny) your plugin is a must!
(Unfortunately, not only your plugin affected by this serialization problem. I’ve tried the above mentioned two links of fixes and that worked well, regardless some \\” issues .
If someone will also use them I suggest reading through their comments too.
Thanks again for your plugin and the modification too.
further good work
cheer
iplnts
Hi White Shadow!
After I’ve made a backup of my previously fixed database I installed your new modified version.
Unfortunately, I also lost again my all menu settings. When I looked into the database ws_menu_options field, I realized the stored data changed but some \/ were written into strangely. Unfortunately, I can not send/write here you this field value completely, because I ‘ve reinstalled your original plugin and restored the database since then.
I mention here this also for your information only, that perhaps really strange happens …
iplnts
Yes, JSON can escape forward slashes (i.e. replace them with “\/”). There might be some arcane format that doesn’t introduce any “strange characters”, but I’m not aware of one.
I guess that just means that running a bruteforce search & replace on the WP database is sometimes inadvisable
Hi White Shadow,
Apologizing for the long messages here, but I only wish to make this issue clear
I think, there is not any problem with your new code and really thanks for your effort making it to be more stable avoiding the manual editing when migrating a site..
—–
The only problem that the previously stored menu order data was yet in the older stored format in the db when I installed and run your new code. I was lazy to arrange the menu again starting to rewrite it from scratch with your new code and saving that, I think.
It is quite true, that the serialize fix and the second search & replace (offered by the above links) may have also very dubious outcomes. (I spent quite enough time yesterday to look through the db carefully after run that serialization-fix.php). Yes, there was some problems with that, too, I had to correct manually.
—–
Your resolution is obviously clear, surely resolving the problem for your plugin setting when migrating a WP db in the future, but (as per my trying) it involves at least once to rearrange/rewrite the menu order again to store the new data format and getting that back well.
****
For my special case, wherefore I decided to put back your previous code:
Generally, this problem did not influence only your stored data, but else options settings made by other plugins too. (However I only presented this problem at present only for you, but not for any else plugin developers whose plugin are also in question for me.)
I had already run the serialize fix before installing your offered new code, and that fix basically resolved the problem at least for me, although I’ve made after running it yet some handwork.
I can consider to use your new code and arrange the menu again manually at least once, save that, but I think too that will resolve the problem only for your plugin when future deploying the site, however I’ll need to use again the serialize fix for the other plugins, and I just don’t know how that will influence your newly stored data. That is the reason, if you understand my problem.
****
Basically I think, this issued problem is for the plugin developers common understanding, as somehow that was mentioned in the http://www.andrewnacin.com/2010/04/18/wordpress-serializing-data/, and I think, I’m not the proper person to further care with it.
Much thanks for you, taking efforts dealing with and resolving this issue, truly.
cheer,
iplnts
Great plugin! I use this as part of my wordpress framework. I have been having a slight issue, that when I migrate a wordpress database, for example going local to live, my settings for this plugin dissapear. It was not like that in previous versions. Any thoughts?
Read the previous half a dozen comments that discuss just that.
Summary : the problem is caused by blindly editing the serialized menu configuration in the wp_options table (e.g. by running a global search & replace to set the new domain name), which makes it invalid. There is as of yet no viable solution.
I followed your directions for installing this plugin in WPMU. When I activate the plugin sitewide i get a brief 500 Internal Server error message and the page redirects to the plugin page with the following error message:
“Plugin could not be activated because it triggered a fatal error.”
Can you help? I love this plugin and will be using it to simplify the menu for many of our users.
Are you sure your server meets the requirements, i.e. PHP 5 or above?
YES. Strangely enough….it still works, but the plugin still shows as non activated on the plugins page. I have not found any other issues with its use yet.
I can’t believe I missed it the first time, but here’s the problem : plugins installed in the /mu-plugins/ folder don’t need to be activated! They’re active by default.
Manually activating the plugin probably caused WP to load it twice, which caused the crash and 500 error.
Hi,
But this extension seems to have developed a very nice, I try to install WordPress 2.9.2 version Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/megatu/public_html/betasite/wp-content/plugins/admin-menu-editor/menu-editor-core.php on line 13 I encountered an error ..
How do I resolve this error is available, what should I do?
Are you sure your server meets the requirements – PHP 5 or later?
Great plugin, excellent work. Thank you.
I’m running it as a site admin on a wpmu 2.9.2 test install on MAMP locally. Works great.
But, when I try import my SQL database on real, online serwer, the plugin lost menu settings. It completely ingore my settings from local instalation.
Of course, I was replacing the local “127.0.0.1″ addresses from exported sql file.
Have you any solution?
This is a known issue. The menu storage format isn’t amenable to manual modification.
To fix this, I’m planning to add an import/export feature in a future version.
OK. Thank you. I’ll be waiting
Is it possible to create custom menus or panels that point to external links for the admin user role? Example: Google Analytics, Google AdSense, FeedBurner Administration or any other external pages.
See my response here.
I would love this too.. I have sat it up today, but would like an option for opening in a new page, or maybe using iframe?
Okay, I’ll add a to-do item for “open in a new window”.
That’s great! Looking forward to see the new feature and improvement.
Thanks for your great support, Janis.
[...] 4. Admin Menu Editor [...]
talk about a cool plugin!! i love it
and it even works in hebrew – cool man
thanks a bunch
Hi,
was happy to see the plugin replace my wp-help riven FAQ for contributers. Yet, I only get 404 errors. I probably don’t know how to handle this plugin right but couldn’t find a description why this happens. Probably there is a very easy solution, but I am more on the prosumer side of wordpress and don’t know what particular thing I did wrong. I’m using wordpress 3.0.
Thanks
Err, so what is the problem you’re having, exactly? What are you trying to do? Where do you get the 404 errors? Give me something to work with
I am trying to have an menu for my people in the role of editor to just be allowed to add or change events from an event calendar plugin I installed and I am totally lost how to get that to show up!
A plugin like Role Scoper might be more suited for your purposes. Admin Menu Editor is useful for defining what capability users need to have to see/use a certain menu item – not what rights individual roles or users possess.
Or in to put the same thing in less words : AME manages the menu, not users.
Hi WS,
Is there a way to have certain plugins activated on the whole network but having their options show up only for the super admin or even better to only certain sites? Right now there is either show ALL plugins or not.
Let me explain. I use the wp db backup. It is a very good but also a very dangerous plugin in the wrong hands. I want to have it activated globally but NOT show it’s options on other admins. Only to super-admin. Same with plugins like shokingly simple favicon or Custom Headers and Footers etc.
Things were simpler when I was the only administrator and not using wordpress3 with multisite. I could hide specific options using Adminimize. I had a request like that
some time back.
With the new multisite feature I think it could be a great option in this beautiful plugin
Thanx in advance, marikamitsos
You can already do that, actually – it’s just somewhat unintuitive. Set the “Required capability” of those menus to “manage_network” and they’ll be visible only to the super admin.
Note : This is not guaranteed to make the functionality of those plugins completely inaccessible for normal users. The plugins might have AJAX hooks, widgets and whatnot, and Admin Menu Editor can’t modify those. The only way to be completely safe is get the respective plugin authors to implement the security scheme you describe.
[...] Admin Menu Editor For WordPress | W-Shadow.com [...]
[...] is a nifty plug-in called Admin Menu Editor by W-Shadow which can quickly resolve this. I tried once to manually edit the PHP files for the toolbar, it was [...]
Hi White shadow,
Great plugin exactly what i needed for a project, however i stupidly hid the settings and plugins menus doh!! and now i dont know how to revert to the default menu (because i hid the settings menu i cant access the admin editor settings) is there any way to manually revert to defaults?
cheers
Indeed there is. Just open http://example.com/wp-admin/?reset_admin_menu=1 in your browser (replace example.com with your blog’s address).
Hi Whiteshadow,
Cheers for the fast reply, I tried the fix as you suggested but it didnt seem to have any effect i neglected to mention the site is on a wordpress mu installation would this be the culprit?
thanks in advance
Are you logged in as the (super) admin? You need to have menu editing permissions for that URL to do anything.
yep im logged in as (super)admin, i cleared browser cache as well to no effect
Well, that’s… interesting. I have no idea why it doesn’t work.
Anyway, if you have direct access to the database, you can also reset the menu by deleting the “ws_menu_editor” option from the “wp_options” table.
Perfect!! that did the trick, thanks for the help!
Hi,
I was wondering if you could help me with this plugin. I am having some issues with it to get it working for different access levels.
I have an ‘Ad manager’ installed, which appears under ‘Settings’ main tab in the admin panel.
‘Admin’ has the rights to upload banners using this plugin and I want ‘editor’ to be able to do that too. I have tried changing the ‘Required capability’ to ’7′, which is the access value for ‘Editor’ in WP database. But it doesnt seem to work.
Any ideas why? Any help will be much appreciated.
Due to the way menu permissions are handled by WordPress, it is not possible to make them less restrictive. Your best bet would be contacting the author of “Ad manager” and asking them to make the plugin’s settings accessible to editors.
Ok, I will try contacting the plugin’s author. Thanks.
having some issues with this plugin… running 3.0.1
…
no default menu comes up in the settings. nothing.
none of the buttons work or are clickable.
any known conflicts with this?
using Firefox.
No known conflicts with WP 3.0.1, but could be a conflict with another plugin. Anything in the browser’s error console?
Error: menuBox.sortable is not a function
Source File: http://xxxxxxxxxxxxxxxxx/wp-content/plugins/admin-menu-editor/js/menu-editor.js?ver=1.0
Line: 422
In the FF error Console.
Try this and tell me what error message it displays now (you might want to take a screen-shot).
You can do this outside plugin usage..
Instead of using add_submenu_page(), etc..
Hook onto admin_menu, but instead globalise the $submenu / $menu vars and add the submenu items manually into the array, else WP won’t deal with the URL/Link correctly, since “all” menu items are prepended with the local site’s URL.
Post on the WP support forums (post in the hacks forum), and i’ll provide an example.
Last response was to anwer Tim who asked about linking menu items to offsite URLs, seems the reply to feature isn’t enabled here, and even replying (if you form the URL) does stack the response under the relevant comment (that’s why my comment seems out of place).
Hi
i have a problem
”
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /homez.348/boitebis/www/wp-content/plugins/admin-menu-editor/includes/menu-editor-core.php on line 18 ”
do u know why ?
thank u so much i really appreciate ur plugin ^^
It looks like your server is running PHP 4, which is not supported by Admin Menu Editor. You’ll have to upgrade to PHP 5 if you want to use this plugin.
reallyyyyy Oo oops ^^
that’s true…
thank u !!!!
Sorry this question is unrelated to your plugin (though it did give me that thought). Is it possible to override the placement of a plugin menu with another plugin? So when plugin A is activated it will move the menu of Plugin B. For instance WP DB Manager would get moved all the way up under Dashboard. Does that make sense? Thanks!
That’s exactly what Admin Menu Editor is for. One of it’s functions is moving and sorting menus.
Of course, it is also be possible to make a simpler plugin that changes the placement of only one or two pre-defined menus. Basically, all you’d need to do is move around the elements of the global $menu array.
hi i m using wp 2.9 , and upload this plugin. but it is not working.
no function at the top panel is not working. please help
I have created a user category “Manager” and definied the capabilities using capability manager. However, no matter what I do, I can’t get the Plugins menu to show up – I want them to be able to view/add plugins, but not edit.
Do the users have the “activate_plugins” capability?
Love this plugin, by far the best I have used for menu management. I use it together with User Role editor.
Two flaws I found it using it so far…
1. For some reason, I can’t hide the Links section
2. It can’t hind NE Gallery plugin.
Besides that.. it’s awesome!
Interesting, I can hide both easily on my test site. Have you changed anything else about those menus?
I use your plugin together with another plugin called User Role Editor. I think they work well together in most cases, but for some reason those two options above don’t work.
With User Role Editor – I created a new “user role” called “Manager”. and removed several options from this role, such as managing links.
With your plugin I set most menus and submenus I don’t want to use to Administrator only and the ones I want to use to “Manager”.
I set the “Links” section to administrator but it’s only hidden when I disable the “Manage Categories” role.
It’s complicated, but there’s some conflict. I have to look closely later on to see how it all works.
Given that the “Manager” role doesn’t have the caps for managing links, what happens when you actually click on that menu?
If it’s visible but inaccessible, you could simply hide it using the gray “Hide” button in Admin Menu Editor.