mezzo Posted September 1, 2015 Share Posted September 1, 2015 Simply put how do I remove the navbar if the client is not logged in? I know it's an "if" function but don't know where to place that. Any help is appreciated. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted September 2, 2015 Share Posted September 2, 2015 It's all about the IF check this documentation: http://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet#Hiding.2FRemoving_a_Menu_Item and here is an example with IF statement: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $userid = intval($_SESSION['uid']); if ($userid=='0'){ if (!is_null($primaryNavbar->getChild('Network Status'))) { $primaryNavbar->removeChild('Network Status'); } } }); using the example code above, Network status URL will be removed from navbar from normal visitors, but not from loggedin clients 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.