Support » Plugins » Add Admin Menu Link to Specific Page

  • Can I use add_submenu_page to go to a specific page? i.e. add a link under “Appearance” that goes to (for instance)

Viewing 1 replies (of 1 total)
  • No, but you can use the adminmenu hook to add to the menu system. That’s with no underscore. If you want it to match style of admin menu do something like this.

    //this inputs our custom menu
    add_filter('adminmenu', 'newMenu');
    function newMenu() { ?>
            <li class='wp-has-submenu menu-top menu-top-first menu-top-last'>
            <div class='wp-menu-image'><br /></div>
            <div class='wp-menu-toggle'><br /></div>
            <a href='admin.php?page=sub-page' class='wp-has-submenu menu-top menu-top-first menu-top-last' tabindex='1'>MenuName</a>
            <div class='wp-submenu'>
            <div class='wp-submenu-head'>Menu Name</div>
                    <li class='wp-first-item'><a href='admin.php?page=sub-page' class='wp-first-item' tabindex='1'>Link</a></li>
                    <li><a href='admin.php?page=sub-page&amp;display=6&amp;query=2'>Link</a></li>
                    <a href='admin.php?page=sub-page&amp;display=6&amp;query=3'>Link</a></li>
    <?php }

    You can put in any links you want that way. If you follow that style the menu will be collapsible like the other admin menus.

Viewing 1 replies (of 1 total)
  • The topic ‘Add Admin Menu Link to Specific Page’ is closed to new replies.