Maver87 Posted August 19, 2019 Share Posted August 19, 2019 Hi people, i need to use an hook to modify some menu items in client area and in particularly in PrimaryNavbar and Sidebar menu, the problem i have is to make work this hook with only specific theme, below part of hook that could be generally but not specific for a custom theme. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar',1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar ->removeChild('Open Ticket'))){ } }); Thank you for your suggestions. Regards 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 20, 2019 Share Posted August 20, 2019 23 hours ago, Maver87 said: i need to use an hook to modify some menu items in client area and in particularly in PrimaryNavbar and Sidebar menu, the problem i have is to make work this hook with only specific theme, below part of hook that could be generally but not specific for a custom theme. if you are wanting to *only* remove items from the navbar/sidebars, then using css might be a simpler option. #Primary_Navbar-Open_Ticket {display: none;} that way you could add your specific css code to that theme's custom.css file and these changes will only apply to that particular theme. if you need to do more than just remove existing items, then a hook would become necessary - in hooks, it is entirely possible for changes only to apply to specific themes / templates or pages. 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.