wordpress plugin

add custom menu to backend / admin dashboard

add_action( 'admin_menu', 'register_my_custom_menu_page' );

function register_my_custom_menu_page(){
add_menu_page(
'page title',
'menu Title',
'manage_options',
'my_custom_menu',
'my_custom_menu_page',
'',
101
);
add_submenu_page(
'my_custom_menu',
'page subtitle',
'sub menu',
'manage_options',
'my_custom_submenu',
'my_custom_submenu_page'
);
add_submenu_page(
'my_custom_menu',
'page subtitle2',
'sub menu2',
'manage_options',
'my_custom_submenu2',
'my_custom_submenu_page2'
);
}
function my_custom_menu_page()
{
echo "Admin Page Test";
}
function my_custom_submenu_page()
{
echo "Admin SUB Page Test";
}

function my_custom_submenu_page2()
{
echo "Admin SUB Page 2";
}