Hi,
I use the following code to hide the Support menu from a specific page and it works fine (code is for when a client is logged in):
<?php
use WHMCS\View\Menu\Item as MenuItem;
if (App::getCurrentFilename() == 'viewticket')
add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar)
{
$client = Menu::context('client');
if (!is_null($client)) {
if (!is_null($secondarySidebar->getChild('Support'))) {
$secondarySidebar->removeChild('Support')
->removeChild('Announcements')
->removeChild('Knowledgebase')
->removeChild('Downloads')
->removeChild('Network Status')
->removeChild('Open Ticket');
}
}
}
);
My issues is that I want to hide the same Support menu on the Knowledgebase page when the client is logged in however the Knowledgebase friendly URL is not a file path and so I'm not sure how to edit the code to reference this. The URL in the address bar is xyz.com/whmcs/knowledgebase (example).
Thanks