Forums

Add menu page without submenu (1 post)

  1. sulfurito
    Member
    Posted 4 months ago #

    Hello, I'm programming a plugin and in the code I'va added a page and some submenus, the problem I have is the page appears as a submenu also, I have:

    add_menu_page( "Myplugin", "Myplugin", "activate_plugins", "Myplugin", "Myplugin_Entry1");
    add_submenu_page( "Myplugin", "Entry1", "Entry1", "activate_plugins", "Myplugin-Entry1", "Myplugin_Entry1" );
    add_submenu_page( "Myplugin", "Entry2", "Entry2", "activate_plugins", "Myplugin-Entry2", "Myplugin_Entry2" );

    And this does:

    Myplugin
    - Myplugin
    - Entry 1
    - Entry 2

    And I wish to have:

    Myplugin
    - Entry 1
    - Entry 2

    What do I need to do?

    I know I shouldn't have "Myplugin_Entry1" as last parameter in add_menu_page( "Myplugin", "Myplugin", "activate_plugins", "Myplugin", "Myplugin_Entry1"); but otherwise I get an error when clicking menu page.

    Thank you

Reply

You must log in to post.

About this Topic

Tags