Move one admin menu to be a submenu

I’m setting up a multisite network where users can create their own sites. I’d like to move one of the wp-admin menu pages to be a submenu of another item. Can you help me with that?

  • Ash
    • WordPress Hacker

    Hello Wayne

    I have added the code in /site/public_html/wp-content/mu-plugins/mu-code.php but I left that commented. That is because, I can remove the Lazada menu easily, but to add that menu in Marketplace menu, Marketplace needs a slug and I don’t see that slug.

    Would you please let me know how that menu is added and can you set a menu slug for that menu? Then use the slug as first parameter of add_submenu_page() function in the code I gave.

    Let us know how it goes. Have a nice day!

    Cheers,

    Ash

  • Wayne
    • Site Builder, Child of Zeus

    Hi, the Marketplace is created with Admin Menu Pro plugin. I do not know how to insert slug on this, Kindly advice.

    Alternatively, can we remove the Marketplaces menu. Then, in the code you created, put a code that once Lazada plugin is activated, then i will create a Marketplaces on admin menu, then lazada will be submenu of Marketplaces.

    Another alternative, can we change the admin menu code in lazada directly? this will be much easy i suppose. (ps i no longer need update from lazada since ive done alot of customization on it.)

  • Ash
    • WordPress Hacker

    Hello Wayne

    I have tried that but it seems the menu editor plugin is somehow overwriting this, I am not sure how.

    So, how’s about removing the Lazada item using the code below as mu-plugin:

    function wpmu_custom_menu_page_removing() {
    remove_menu_page( 'ced-lazada-config' );
    }
    add_action( 'admin_menu', 'wpmu_custom_menu_page_removing', 99999 );

    and then you can create submenu from menu editor under marketplace main menu and use the “admin.php?page=ced-lazada-config” as submenu slug.

    Let us know if that works for you. Have a nice day!

    Cheers,

    Ash

  • Wayne
    • Site Builder, Child of Zeus

    Hi ash,

    I cant use menu editor to add lazada into submenu of Marketplaces because lazada will not be activated from my network admin. This will only be activated on some of the subsites.

    If thats the case, how about i remove marketplaces menu. then will you be able to insert a code into lazada plugin to do:

    1) once activate, it will create a menu (Marketplaces).

    2) lazada will be submenu of Marketplaces. Name will be “Lazada”

  • Nithin
    • Support Wizard

    Hi Wayne,

    If thats the case, how about i remove marketplaces menu. then will you be able to insert a code into lazada plugin to do:

    1) once activate, it will create a menu (Marketplaces).

    2) lazada will be submenu of Marketplaces. Name will be “Lazada”

    Sorry for the delay in getting back to you. I’m afraid, there isn’t an easy workaround other than using an Admin Menu Editor plugin. This would require a lot of custom coding, and depends upon the callbacks used by the “Lazada” plugin.

    Could I know whether you are using a custom plugin or a whitelisted plugin? Please provide the link to the plugin page if it’s a whitelisted one so that we could check whether there are any workarounds possible via the plugin side hooks.

    Please advise so that we could help get this sorted asap. Have a nice day ahead.

    Kind Regards,

    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.