how to only add a top-level admin menu without it creating a sub-level-menu

Effectively you can do this by adding a sublevel item with the same menu slug as the top level, while changing the submenu item title. This avoids the look of duplicate menu items, even though the destination of the top level, and the first sub menu item are the same.

You have to have at least two sub menu items, and one will be a duplicate destination as your top level menu item.

For example:

add_action( 'admin_menu', 'add_travel_menu' );
function add_travel_menu() {
        add_menu_page('Travel Site Menu', 'Travel Site', 'manage_options', 'travel-site-menu', 'ts_admin_main_page');
        add_submenu_page('travel-site-menu', 'Travel Site', 'View Travel Site', 'manage_options', 'travel-site-menu', 'ts_admin_main_page');
        add_submenu_page('travel-site-menu', 'View Travel Requests', 'View Travel Requests', 'manage_options', 'ts-view-travel-requests', 'ts_admin_main_page');
}
function ts_admin_main_page() {
    if ( !current_user_can( 'manage_options' ) )  {
        wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
    }
    echo '<div class="wrap">';
    echo '<p>Here is where the form would go if I actually had options.</p>';
    echo '</div>';
}

This would create the Following Menu:

  • Travel Site -> travel-site-menu
    • View Travel Site -> travel-site-menu
    • View Travel Requests -> ts-view-travel-requests

enter image description here

The function ts_admin_main_page actually creates the page that will be the destination for “Travel Site” and “View Travel Site”. You would need to create the the similar function “ts_admin_vtr_page” that will create the sub page destination for “View Travel Requests”.