کد PHP:
<?php
use WHMCS\View\Menu\Item as MenuItem;
// Add term of services links to the end of all primary navbar.
add_hook('ClientAreaPrimaryNavbar', 8, function (MenuItem $primaryNavbar)
{
// Add a Menu to the end of the Primary navbar for Term Of Services links.
// Declare it with the name "term-of-services" so we can easily retrieve it
// later.
$primaryNavbar->addChild('term-of-services', array(
'label' => 'قوانین ارائه سرویس',
'order' => '1',
'uri' => '#',
));
// Retrieve the panel we just created.
$temOfservicesPanel = $primaryNavbar->getChild('term-of-services');
// Move the panel to the end of the sorting order so it's always displayed
// as the last panel in the sidebar.
$temOfservicesPanel->moveToBack();
// Add a Submenu1 link to the panel.
$temOfservicesPanel->addChild('submenu-1', array(
'uri' => 'tos.php',
'label' => 'قوانین و شرایط کلی',
'order' => 1,
));
// Add a Submenu2 link to the panel after the submenu1 link.
$temOfservicesPanel->addChild('submenu-2', array(
'uri' => 'servertos.php',
'label' => 'قوانین خدمات میزبانی',
'order' => 2,
));
// Add a Submenu3 link to the panel after the submenu2 link.
$temOfservicesPanel->addChild('submenu-3', array(
'uri' => 'domaintos.php',
'label' => 'قوانین خدمات دامنه',
'order' => 3,
));
});