I have created a plugin and now i want to add a third party plugin inside of the Main Plugin menu, so it can be submenu. How do you make the second plugin appear?

Directory Setup:


/wp-content/plugins/main/My_builder <----Second Plugin

What i have:

function Main_admin_exist() {
  add_menu_page('Main', 'Main', 'manage_options', 'main', 'Main_Dashboard', plugins_url( 'Main/images/icon.png' ));
} add_action('admin_menu', 'Main_admin_exist');

/*Add Sub Menu or Third Parties Plugin to Main*/
function mainThirdPartyPlugin(){
    add_submenu_page('main', 'SecondPlugin', 'My Builder', 'manage_options' , 'SecondPlugin', 'SecondPlugin');
}add_action('admin_menu', 'mainThirdPartyPlugin'); 
  • It'll help if you case also post what's not working. Are you getting an error? What do you expect and what's happening instead?
    – mrwweb
    Aug 28, 2014 at 3:28
  • It is adding two menus under Main: Main and My Builder. What result are you expecting? Aug 28, 2014 at 3:36
  • @Nilambar Yes, the menu appear but the content of the second plugin is not appearing. Aug 28, 2014 at 3:46
  • Oh, you mean, you just want to add menu link of second plugin that will redirect to page of second plugin? Aug 28, 2014 at 3:48
  • Yes, but the second plugin folder is within the main plugin folder Aug 28, 2014 at 3:48


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.