Code snippet how to remove sidebar information from WHMCS

The following code snippet will remove / manipulate sidebar information:

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar)
{
   if (!is_null($secondarySidebar->getChild('Support'))) {
               $secondarySidebar->getChild('Support')
                               ->removeChild('Announcements')
                               ->removeChild('Knowledgebase')
                               ->removeChild('Downloads');
   }
}); 

References:
https://whmcs.community/topic/276021-how-to-remove-or-edit-sidebar-from-knowledgebase-announcements/
https://github.com/WHMCS/developer-docs/issues/132

Tags

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top