I have created a custom menu page using add_menu_page() function. Everything in that page appears as it should in the screen. What I am trying to achieve is adding another submenu under the under the page i previously created(i want it to appear just like when you click on the settings menu in wordpress
dashboard). I am pasting a code snippet below:
//creating the menu item for the plugin
function qpv_custom_menu_link() {
add_menu_page(
'Quick Product View Options',
'Quick Product View',
'manage_options',
'qpv-options',
'qpv_options_page',
'',
'100'
);
add_submenu_page(
'qpv-options',
'Quick Product View Appearance',
'Quick Product View Appearance Settings',
'manage-options',
'qpva-options',
'qpva_options_page'
);
}
add_action( 'admin_menu', 'qpv_custom_menu_link' );
//creating the submenu page settings
function qpva_options_page(){
ob_start(); ?>
<h2>Hello</h2>
<?php
echo ob_get_clean();
}
I have also checked the wordpress
codex and have followed the given instructions, but my problem remains and the submenu page still does not show up in under the plugin name.