mic141414 Posted June 2, 2017 Share Posted June 2, 2017 Hello, [ATTACH=CONFIG]14202[/ATTACH] Those 2 items (downloads and network status) I did not manage to remove them All my attempts ends up with the site not working. I used the hooks doc. I spent a lot of time trying all the codes I have seen in the doc. But nothing. Can someone tell me how to do it please? Thank you in advance. - - - Updated - - - attachment does not seem to work https://i.imgur.com/EUFfqpQ.png 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 2, 2017 Share Posted June 2, 2017 try the following... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->getChild('Support') ->removeChild('Downloads') ->removeChild('Network Status'); } }); 0 Quote Link to comment Share on other sites More sharing options...
mic141414 Posted June 2, 2017 Author Share Posted June 2, 2017 @brian! Thank You so much. It worked. I was not far but dumb enough not to figure it out. It is working perfectly!!! Thanks! 0 Quote Link to comment Share on other sites More sharing options...
mic141414 Posted June 2, 2017 Author Share Posted June 2, 2017 Can I ask one more thing (i am sorry to ask something else) How to remove Contact (Add New contact) that: https://i.imgur.com/K40CBth.png 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 2, 2017 Share Posted June 2, 2017 Can I ask one more thing (i am sorry to ask something else)How to remove Contact (Add New contact) that: https://i.imgur.com/K40CBth.png not a problem... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->removeChild('Client Contacts'); } }); or if you want to combine them together in one file (so that you don't have too many separate hook files)... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->getChild('Support') ->removeChild('Downloads') ->removeChild('Network Status'); } if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->removeChild('Client Contacts'); } }); 0 Quote Link to comment Share on other sites More sharing options...
mic141414 Posted June 2, 2017 Author Share Posted June 2, 2017 Thank you!! Everything is working and everything I wanted gone is gone thanks to you. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.