add multipe sub menus using add_submenu_page

a loop is almost always a good solution to avoid to copy-paste code. you just need to use a array of datas like that : $submenus = [ [ “page_title” => “page1”, “menu_title” => “title1”, “slug” => “wp-admin.php”, ], [ “page_title” => “page2”, “menu_title” => “title2”, “slug” => “wp-login.php”, ], ]; foreach ($submenus as $value) … Read more

How to link a Custom Post Type submenu to a Nextgen Gallery page?

It would go like this (note the absence of the function parameter – and also the capability instead of a role). add_action( ‘admin_menu’, ‘wpse_74421_menu_admin’ ); function wpse_74421_menu_admin() { add_submenu_page( ‘edit.php?post_type=events’, ‘Add Gallery’, ‘Add Gallery’, ‘delete_plugins’, ‘admin.php?page=nggallery-add-gallery’ ); }

tech