I am trying to customize the admin area using the functions.php file to make things easier for my clients. One request I have got before and hope to be able to accomplish, is to move some of the sub menus into the main navigation.
For instance I would like to make Widgets and Menus appear in the main navigation as opposed to being a submenu for Appearances. I would then end up removing the Appearances tab all together.
I have been able to remove the tab but unable to make the new buttons for Widgets and Menus. Even if I can get help of not technically moving them but instead creating a new button and setting the link myself (ex. for Menus -> /nav-menus.php).
Is any of that possible?
Thanks
OK, it’s a bit messy, but it works. Take a look
Essentially it is removing the nav menu settings from the Appearance sub-panel, then re-adding it as a top level page (similar to a plugin). You can set an icon URL in there as well. The only part I can’t get working the way I want is the positioning.
As for WordPress 4.4 I have to use following code to make it work:
You can change the order by using the menu_order filter:
This was taken from this article here: customizing your wordpress admin
Notice that the nav-menu.php has been added to the top level menu. To re-position each menu item just rearrange them.
Good article on this, old link that can help with this, http://wpengineer.com/475/top-level-menu-in-wordpress-27/
Also, the solution that @Norcross is proposing works great, but the icon 99 will throw an error, you could leave it blank, eg.
''
instead of 99. You could also have your own custom icon usingbasename(__FILE__)
and the filename.It’s even simpler if, like the OP, you only want to move Menus and Widgets out of Appearance and to the top level. That’s what I needed too.
Since we’re just moving WP core menu items around, we don’t need to use
add_menu_page
to add the menu items back in – we’re not adding any new menu items. Just unset them from the $submenu array and re-set them elsewhere in the $menu array.Norcross’s answer above put me on the right track, but for whatever reason using
add_menu_item
did not regenerate a working “Nav Menu” section as a top level menu item in the admin for me in WP 4.1. The problem seemed to lie in the order of the array values passed to that function, but no matter how I reordered things, working straight off the new WP Developer API article, i never got it working.this should work. also with the positioning. in this case menu position: 3. just abide to wordpress struktur: