I'm trying to understand creating custom plugin pages and menus in admin panel, but I get what I don't need. I've got:
function my_plugin_add_pages() {
add_menu_page(__('Custom quiz', 'custom-quiz'), __('Custom quiz', 'custom-quiz'), 5, 'custom-quiz-listing-page', 'custom_quiz_list_page');
add_submenu_page('custom-quiz-listing-page', __('Add quiz'), __('Add quiz'), 6, 'custom_quiz_add_quiz', 'custom_quiz_add_quiz');
add_submenu_page('custom-quiz-listing-page', __('Edit quiz'), __('Edit quiz'), 6, 'custom_quiz_edit_quiz', 'custom_quiz_edit_quiz');
}
function custom_quiz_list_page() {
require_once('includes/quiz-listing.php');
}
function custom_quiz_add_quiz() {
if (!empty($_POST)) {
CreateQuiz($_POST);
echo '<meta http-equiv="refresh" content="0;url=?page=custom-quiz-listing-page" />';
}
require_once('includes/add-quiz.php');
}
function custom_quiz_edit_quiz() {
if (!empty($_GET['quiz_id']) && !empty($_POST))
UpdateQuiz($_POST);
require_once('includes/edit-quiz.php');
}
And the problem is that all these pages (even subpages) are created in menu sidebar in admin panel. How to create page correctly without sticking it into admin menu?