Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?

Your menu slug (5th parameter) can’t be the same across multiple pages, and it obviously can’t have an & in it, but you can have all the pages you want call the same callback function (the last param).

add_submenu_page('upload_manage', "Programs", "Programs", 'manage_options', 'manage-programs', "manage_data");
add_submenu_page('upload_manage', "Schedule", "Schedule", 'manage_options', 'manage-schedule', "manage_data");

Then in the manage_data function, check the value of $_GET[‘page’] for the slug and act accordingly.

Leave a Comment