Change a Sidebar Menu Link

You can customize the Client Area’s sidebar navigation menus through hooks and custom modules.

For more information, see Client Area Sidebars and our Developer Documentation.

You can change where a sidebar menu item points to using the setUri method. For example, if you use an external system to control announcements, you could use the following example:

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) {
    $primarySidebar->getChild('My Account')
        ->getChild('Billing Information')
        ->setUri('https://www.example.com/billingInfo');
});

Last modified: October 29, 2024