The following hooks are provided for Domain related events.
Executes when a domain is being deleted from the client account.
| Variable | Type | Notes |
|---|---|---|
| userid | int | |
| domainid | int |
No response supported
<?php
add_hook('DomainDelete', 1, function($vars) {
// Perform hook code here...
});Executes when the domain is being edited via the Client Profile Summary and Domains tabs in the Admin Area.
| Variable | Type | Notes |
|---|---|---|
| userid | int | |
| domainid | int |
No response supported
<?php
add_hook('DomainEdit', 1, function($vars) {
// Perform hook code here...
});Executes when a domain transfer is set to completed by the domain sync cron.
| Variable | Type | Notes |
|---|---|---|
| domainId | int | The unique identifier for the domain |
| domain | string | The domain name |
| registrationPeriod | string | The registration period |
| expiryDate | string | The expiry date (if returned by the registrar) |
| registrar | string | The registrar used |
No response supported
<?php
add_hook('DomainTransferCompleted', 1, function($vars) {
// Perform hook code here...
});Executes when a domain transfer is set to failed by the domain sync cron.
| Variable | Type | Notes |
|---|---|---|
| domainId | int | The unique identifier for the domain |
| domain | string | The domain name |
| registrationPeriod | string | The registration period |
| expiryDate | string | The expiry date (if returned by the registrar) |
| registrar | string | The registrar used |
No response supported
<?php
add_hook('DomainTransferFailed', 1, function($vars) {
// Perform hook code here...
});Executes as domain validation is being run
| Variable | Type | Notes |
|---|---|---|
| sld | string | The sld of the domain. eg whmcs in whmcs.com |
| tld | string | The tld of the domain. eg com in whmcs.com |
No response supported
<?php
add_hook('DomainValidation', 1, function($vars) {
// Perform hook code here...
});Executes before a domain register command
| Variable | Type | Notes |
|---|---|---|
| domain | string | The domain being registered |
No response supported
<?php
add_hook('PreDomainRegister', 1, function($vars) {
// Perform hook code here...
});Executes before a domain transfer command
| Variable | Type | Notes |
|---|---|---|
| params | array | Common domain registrar parameters. See http://developers.whmcs.com/domain-registrars/module-parameters/ |
No response supported
<?php
add_hook('PreDomainTransfer', 1, function($vars) {
// Perform hook code here...
});Executes prior to the registrar function being executed for a domain. Allows the action to be aborted.
| Variable | Type | Notes |
|---|---|---|
| params | array | Array of common module parameters. See https://developers.whmcs.com/domain-registrars/module-parameters/ |
Accepts an optional array return. Return abortWithSuccess=true to abort the action and treat it as successful. Return abortWithError=Error messages goes here to abort the action and treat it as failed.
<?php
add_hook('PreRegistrarRegisterDomain', 1, function($vars)
{
$domainName = $vars['params']['sld'] . '.' . $vars['params']['tld'];
return array(
'abortWithError' => 'Error message to display goes here',
);
//return array(
// 'abortWithSuccess' => true,
//);
}
);Executes prior to the registrar function being executed for a domain. Allows the action to be aborted.
| Variable | Type | Notes |
|---|---|---|
| params | array | Array of common module parameters. See https://developers.whmcs.com/domain-registrars/module-parameters/ |
Accepts an optional array return. Return abortWithSuccess=true to abort the action and treat it as successful. Return abortWithError=Error messages goes here to abort the action and treat it as failed.
<?php
add_hook('PreRegistrarRenewDomain', 1, function($vars) {
// Perform hook code here...
});Executes prior to the registrar function being executed for a domain. Allows the action to be aborted.
| Variable | Type | Notes |
|---|---|---|
| params | array | Array of common module parameters. See https://developers.whmcs.com/domain-registrars/module-parameters/ |
Accepts an optional array return. Return abortWithSuccess=true to abort the action and treat it as successful. Return abortWithError=Error messages goes here to abort the action and treat it as failed.
<?php
add_hook('PreRegistrarTransferDomain', 1, function($vars) {
// Perform hook code here...
});Executes when a new domain extension is added.
| Variable | Type | Notes |
|---|---|---|
| tld | string | |
| supportsDnsManagement | bool | |
| supportsEmailForwarding | bool | |
| supportsIdProtection | bool | |
| requiresEppCode | bool | |
| automaticRegistrar | string |
No response supported
<?php
add_hook('TopLevelDomainAdd', 1, function($vars) {
// Perform hook code here...
});Executes when a domain extension is deleted.
| Variable | Type | Notes |
|---|---|---|
| tld | string |
No response supported
<?php
add_hook('TopLevelDomainDelete', 1, function($vars) {
// Perform hook code here...
});Executes when domain extension pricing is updated.
| Variable | Type | Notes |
|---|---|---|
| tld | string |
No response supported
<?php
add_hook('TopLevelDomainPricingUpdate', 1, function($vars) {
// Perform hook code here...
});Executes when domain extensions configuration is updated.
| Variable | Type | Notes |
|---|---|---|
| modifiedTlds | string[] | An array of domain extensions that have been modified. |
No response supported
<?php
add_hook('TopLevelDomainUpdate', 1, function($vars) {
// Perform hook code here...
});