xelatirdan Posted February 29, 2016 Share Posted February 29, 2016 Hello! Can you help me with hide "Client details" block in clientarea. (i.imgur.com/szrmpcv.png) I've found one way, but it is bad way: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { $client = Menu::context('client'); $address_new = $client->fullname; if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->removeChild('Client Details') ->addChild('Client Details') ->moveToFront() ->addChild($address_new); } }); - - - Updated - - - Sorry for bad link, new screenshoot: i.imgur.com/YL7GFQF.png 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 29, 2016 Share Posted February 29, 2016 you should remove it using an action hook - create a file in includes/hooks and called it removeinfosidebar.php and add the following code to it... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->removeChild('Client Details'); } }); when you refresh the page where the sidebar was, it should now be gone. 0 Quote Link to comment Share on other sites More sharing options...
xelatirdan Posted March 1, 2016 Author Share Posted March 1, 2016 you should remove it using an action hook - create a file in includes/hooks and called it removeinfosidebar.php and add the following code to it... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->removeChild('Client Details'); } }); when you refresh the page where the sidebar was, it should now be gone. Thank you it is work, but I try this hook later and he doesn't work maybe I used wrong syntax. Many thaks! 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.