• For the life of me I can’t figure out how my plugin can add a menu item to a custom top level administration menu.

    Having already (in my theme’s function.php) created a top level menu with:
    add_menu_page('Name', 'NM', 'manage_options', 'slug', 'foo', get_stylesheet_directory_uri() . '/images/menu.png', 30);

    Here are the ways I’ve tried to create a sub menu item in a plugin – none work:

    // This causes "You do not have privileges!
    add_submenu_page('slug', 'Manage', 'Title', 'manage_options', 'admin.php?page=pws', 'pws_func');
    // This goes to the public view with "Not found"!
    add_submenu_page('slug', 'Manage', 'Title', 'manage_options', 'pws', 'pws_func');

    Help please!

    Regards,
    Pete

  • The topic ‘How to add a menu item to a custom top level admin menu?’ is closed to new replies.