Hi Brian,
i create this hook using your sintax to remove a especific item of sidebar menu,
actually works, but when i change page i got an error,
this is the code
<?php
use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
$primarySidebar->getChild('My Account')
->removeChild('Contacts/Sub-Accounts');
});
the error is:
Fatal error: Call to a member function removeChild() on null in /var/www/vhosts/gleads.com.br/fin.gleads.com.br/includes/hooks/remove_item_sidebar.php on line 8
thanks