dpgthing Posted August 29, 2019 Share Posted August 29, 2019 Hello, I'm looking to make a hook to hide the "Change Password" button on the sidebar in the client area when they view their product details. Any help? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 29, 2019 Share Posted August 29, 2019 8 hours ago, dpgthing said: Hello, I'm looking to make a hook to hide the "Change Password" button on the sidebar in the client area when they view their product details. if all you want to do is hide it for everyone, e.g you don't need to use conditions based on other factors such as products, you could add the code below to your custom.css file and that would hidee the sidebar child... #Primary_Sidebar-Service_Details_Actions-Change_Password { display: none; } if you really want to use a hook... <?php # Add Icons To Service Actions Sidebar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $ActionDetails = $primarySidebar->getChild("Service Details Actions"); if (empty($ActionDetails)) { return; } $ActionDetailsChildren = $ActionDetails->getChildren(); $kidsToIcon = ["Change Password"]; foreach($ActionDetailsChildren as $key => $Action_details_child) { if (in_array($key, $kidsToIcon)) { $ActionDetails->removeChild($key); } } }); 0 Quote Link to comment Share on other sites More sharing options...
dpgthing Posted August 29, 2019 Author Share Posted August 29, 2019 Thank you! I tried the .css but it didn't work out, however, the hook, wonderful! Perfection and I thank you so very much! 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.