WHMCS需求:移除联系我们

2023年1月31日 | 分类: 【技术】

有人通过 WHMCS 的 Contact us 发送垃圾邮件,怎样隐藏呢?

讨论:https://whmcs.community/topic/291697-how-to-hide-the-conta-us-page/

方案1:创建一个钩子

WHMCS/includes/hooks/removecontactus.php

<?php
# Remove Contact Us Menu Item Hook
# Written by brian!

use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
	if (!is_null($primaryNavbar->getChild('Contact Us'))) {
		$primaryNavbar->removeChild('Contact Us');
	}
});

方案2:在 css 中隐藏

编辑 /templates/six/css/custom.css

添加如下代码:

#Primary_Navbar-Contact_Us {
    display: none;
}

也有需求隐藏工单系统:

讨论:https://whmcs.community/topic/284937-remove-ticketsupport-system/
讨论:https://whmcs.community/topic/215549-how-to-hidedisable-support-ticket-in-my-client-area/

Or create an .htaccess 301 redirect. Imo it’s better because in this way you don’t have to worry when you replace template files when you install updates, templates or edit existing ones.

Redirect 301 /supporttickets.php http://whateveryouwant.example.com/support