Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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/

/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'); 
share|improve this question
    
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 at 3:28
    
It is adding two menus under Main: Main and My Builder. What result are you expecting? –  Nilambar Aug 28 at 3:36
    
@Nilambar Yes, the menu appear but the content of the second plugin is not appearing. –  Brian S Aug 28 at 3:46
    
Oh, you mean, you just want to add menu link of second plugin that will redirect to page of second plugin? –  Nilambar Aug 28 at 3:48
    
Yes, but the second plugin folder is within the main plugin folder –  Brian S Aug 28 at 3:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.