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 :

Admin Menu Editor screenshot

Download

menu-editor.zip (27 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 ;)
  • You can’t use arbitrary URLs as menu targets because WordPress will automatically strip off the “http:/”.
  • 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.

Merry Christmas, by the way :)

Share :
  • Reddit
  • del.icio.us
  • Digg
  • StumbleUpon
  • DZone
  • Ping.fm
  • Sphinn
Related posts :

139 Responses to “Admin Menu Editor For WordPress”

Pages: « 1 [2] 3 4 5 » Show All

  1. 20
    Tobias says:

    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!

  2. [...] as there are no enhancements filed, nor is it in the features survey. Additionally, there is already a plugin to do so, making this exceedingly unlikely. As for the syntax highlighting, there has been [...]

  3. 22
    White Shadow says:

    @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.

  4. 23
    Ben says:

    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!

  5. 24
    Benjamin Allison says:

    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.

  6. 25
    White Shadow says:

    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.

  7. 26
    Benjamin Allison says:

    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.

  8. 27
    Benjamin Allison says:

    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.

  9. 28
    White Shadow says:

    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.

  10. 29
    Benjamin Allison says:

    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.

  11. 31
    Tad says:

    Hi im experiencing a problem where the menu items are not dragging or dropping or anything. is this a javascript problem?

  12. 32
    White Shadow says:

    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).

  13. 33
    danf says:

    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/

  14. 34
    danf says:

    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.

  15. 35
    White Shadow says:

    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.

  16. 36
    danf says:

    Same issue – It doesnt look like there are any changes in the new download. Has it been updated?

  17. 37
    White Shadow says:

    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.

  18. 38
    danf says:

    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?

  19. 39
    White Shadow says:

    I tried the link just now and it’s showing 0.1.2 for me. Perhaps some kind of web cache on your end?

  20. 40
    danf says:

    Sweet – I had to download it in IE to get latest. Not sure why caching in Firefox.

    Loaded it and it works! Thanks!

  21. 41
    Hannes says:

    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…

  22. 42
    White Shadow says:

    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…

  23. 43
    David says:

    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

  24. 44
    White Shadow says:

    Not in this version, but thanks for the idea.

  25. 45
    Sarah says:

    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!

  26. 46
    Hannes says:

    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!

  27. 47
    Hannes says:

    ups – the duplicate qTranslate buttons reappeared. But as they all work I don’t mind (:

  28. 48
    Steve says:

    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

  29. 49
    Steve says:

    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?

Pages: « 1 [2] 3 4 5 » Show All

Leave a Reply