I have a Plugin with 3 submenu_pages. In one page is a formular (in one some text and in one a list of items). when I submit the form, there will be done some processing. after that I don't want to get back to the form-page, but WP shell redirect me to one of the other submenu_pages (in this case a list).
how can I achive this?
add_menu_page( 'page1 main page', '0', 'manage_options', 'mg-pi', 'mg_backend');
add_submenu_page( 'mg-pi', 'list smthing', '0', 'manage_options', 'mg-pi-sub-list', 'mg_list');
add_submenu_page( 'mg-pi', 'create', '0', 'manage_options', 'mg-pi-sub-create', 'mg_new_item');
so in mg_new_item()
is the processing and then it shell redirect to mg_list()
. but if I do the php call to mg_list()
the url is still the one of mg_new_item()
.
I know I could do some header("Location: the-hardcoded-list-url");
but I am looking for the WordPress common way of doing it, with generic Url generation.