WordPress.org

Ready to get started?Download WordPress

Forums

Double top-level and sub-level menu item (1 post)

  1. Libor Jelinek
    Member
    Posted 5 years ago #

    Hi all!
    Adding top-level menu page item (next to Publish, Manage, Look&Feel, Comments) also adds subpage with the same name. But I don't want it!

    add_menu_page('MyMenu', 'MyMenu', 7, __FILE__);
    add_submenu_page(__FILE__, 'Submenu 1', 'Submenu 1', 7, 'submenu1', 'print_submenu_1');
    add_submenu_page(__FILE__, 'Submenu 2', 'Submenu 2', 7, 'submenu2', 'print_submenu_2');

    Creates:

    Publish | Manage | Look&Feel | MyMenu |
    +----------------------------|        |---------------+
    | MyMenu | Submenu 1 | Submenu 2                      |
    |                                                     |
    |                                                     |
    |                                                     |
    +-----------------------------------------------------+

    But I don't want to have "MyMenu" again on submenu level... It doesn't have any sence for me. When I click to "MyMenu" top-level I want to see "Submenu 1".

    How to get rid of double "MyMenu" top-level and sub-level items?

    Thanks
    Libor

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.