Jump to content

Modify PrimaryNavbar & SecondarySidebar


So, who am I ?

Recommended Posts

Hello,

I want to remove Provisioning Module Products from PrimaryNavbar and Provisioning Module Sample Panel from SecondarySidebar.

For PrimaryNavbar I use ClientAreaPrimaryNavbar hook, weird thing is that I can hide every child of 'Services' except Provisioning Module Products,  it seems I can't reach to Provisioning Module Products, but not sure why...

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{   

   if (!is_null($primaryNavbar->getChild('Services'))) {
       $primaryNavbar->getChild('Services')
                       ->removeChild('Provisioning Module Products');
   }

});

 

For SecondarySidebar I use ClientAreaSecondarySidebar, but I can't hide it either.
 

add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar)
{  

   if (!is_null($secondarySidebar->getChild('Provisioning Module Sample Panel'))) {
       $secondarySidebar->removeChild('Provisioning Module Sample Panel');
   }

});

 

 

Any help would be much appreciated.

Link to comment
Share on other sites

3 hours ago, So, who am I ? said:

I want to remove Provisioning Module Products from PrimaryNavbar and Provisioning Module Sample Panel from SecondarySidebar.

wouldn't it be easier to remove their creation from the module hook rather than trying to do it after it's been created using another hook ?

https://github.com/WHMCS/sample-provisioning-module/blob/master/modules/servers/provisioningmodule/hooks.php

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated