Modifying the WordPress Menu

Modifying the WordPress Menu

A few months ago I was reading an article on WPMU about improving usability of WordPress. One of the suggestions by the author of the article was to move Media and Links to Tools as sub-menus in the WordPress Menu. Below is code that I created will do that trick.

add_action('admin_head', 'edit_admin_menu');

function edit_admin_menu(){
    global $menu, $submenu;

    // Copy and unset Media menu item
    $media = $menu[10];
    unset($menu[10]);

    // Copy and Unset Links menu item
    $links = $menu[15]; 
    unset($menu[15]);


    // Add Submenus for Media and Links to Tools
    $submenu['tools.php'][25] = $media;
    $submenu['tools.php'][30] = $links;

    // Sort array
    ksort($menu);
}

Please leave a comment below on any other useful code you have for improving the usability of WordPress.

Tags:
css.php