This code is using a ClientAreaFooterOutput hook to inject a JavaScript snippet into the footer of the client area pages.
This script hides all domain nameserver input fields by selecting elements with names starting with "domainns" and then hiding the closest parent element with the class "col-sm-4."
This is an effective approach to hide the domain nameserver input fields on the client area pages.
When the page loads, the script will run, and all the nameserver input fields will be hidden.
You will also need to edit the /lang/english.php file.
//$_LANG['domainnameservers'] = "Nameservers";
//$_LANG['cartnameserversdesc'] = "If you want to use custom nameservers then enter them below. By default, new domains will use our nameservers for hosting on our network.";
Please make sure to place this PHP code in a file for example. remove_nameservers_code.php within the includes/hooks directory of your WHMCS installation.
<?php
add_hook('ClientAreaFooterOutput', 1, function() {
return <<<HTML
<script>
$(document).ready(function() {
// Hide all domain nameserver input fields
$('[name^="domainns"]').closest('.col-sm-4').hide();
});
</script>
HTML;
});