Skip to content

Addon

The following hooks are provided for Addon related events.

AddonActivated

Executes when an addon status is changed to Active.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridint
serviceidint
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonActivated', 1, function($vars) {
    // Perform hook code here...
});

AddonActivation

Executes when a product addon becomes active as part of invoice payment or order acceptance, following any provisioning or welcome email automation.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridintAn alias for $clientid maintained for backwards compatibility
clientidintThe client associated with the addon's service
serviceidintThe product service the addon is being activated for (tblhosting)
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonActivation', 1, function($vars) {
    // Perform hook code here...
});

AddonAdd

Executes when an addon is added to a product/service.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridint
serviceidint
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonAdd', 1, function($vars) {
    // Perform hook code here...
});

AddonCancelled

Executes when an addon is cancelled.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridint
serviceidint
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonCancelled', 1, function($vars) {
    // Perform hook code here...
});

AddonConfig

Executes as an addon is being displayed.

Parameters

VariableTypeNotes
idintThe id of the created addon (tbladdons).

Response

an array of key -> value pairs to be displayed on the addon configuration.

Example Code

<?php

add_hook('AddonConfig', 1, function($vars) {
    return [
        'Additional Field 1' => '<input type="text" name="additionalFieldOne" class="form-control input-150" />',
        'Additional Field 2' => '<input type="text" name="additionalFieldTwo" class="form-control input-150" />',
    ];
});

AddonConfigSave

Executes as an addon is being saved.

Parameters

VariableTypeNotes
idintThe id of the created addon (tbladdons).

Response

No response supported

Example Code

<?php

//Obtain the values defined in the AddonConfig hook point and save them as required
add_hook('AddonConfigSave', 1, function($vars) {
    $addonId = $vars['id'];
    $additionalFieldOne = $_REQUEST['additionalFieldOne'];
    $additionalFieldTwo = $_REQUEST['additionalFieldTwo'];

    //Save the data here
});

AddonDeleted

Executes when an addon has been deleted.

Parameters

VariableTypeNotes
idintThe id of the addong that has been deleted. tblhostingaddons

Response

No response supported

Example Code

<?php
add_hook('AddonDeleted', 1, function($vars) {
    // Perform hook code here...
});

AddonEdit

Executes when an addon is modified or updated except for status updates.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridint
serviceidint
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonEdit', 1, function($vars) {
    // Perform hook code here...
});

AddonRenewal

Executes when a product addon is being automatically renewed as part of an invoice payment.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridint
serviceidint
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonRenewal', 1, function($vars) {
    // Perform hook code here...
});

AddonSuspended

Executes when an addon is suspended.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridint
serviceidint
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonSuspended', 1, function($vars) {
    // Perform hook code here...
});

AddonTerminated

Executes when an addon is terminated.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridint
serviceidint
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonTerminated', 1, function($vars) {
    // Perform hook code here...
});

AddonUnsuspended

Executes when an addon is unsuspended.

Parameters

VariableTypeNotes
idintThe addon ID (tblhostingaddons)
useridint
serviceidint
addonidintThe predefined addon ID (tbladdons)

Response

No response supported

Example Code

<?php
add_hook('AddonUnsuspended', 1, function($vars) {
    // Perform hook code here...
});

AfterAddonUpgrade

Executes after an addon upgrade has been processed.

Parameters

VariableTypeNotes
upgradeidint

Response

No response supported

Example Code

<?php
add_hook('AfterAddonUpgrade', 1, function($vars) {
    // Perform hook code here...
});

LicensingAddonReissue

Executes as a license is being reissued

Parameters

VariableTypeNotes
licenseidint
serviceidint
addon_idint

Response

No response supported

Example Code

<?php
add_hook('LicensingAddonReissue', 1, function($vars) {
    // Perform hook code here...
});

LicensingAddonVerify

Executes as a license remote check is being completed

Parameters

VariableTypeNotes
licenseidint
serviceidint
xmlresponsestringThe current XML response

Response

Return key value pairs of additional items to be returned with the response.

Example Code

<?php

add_hook('LicensingAddonVerify', 1, function($vars) {
    return [
        'myExtraVariable' => 'Yes',
        'myOtherVariable' => 'Sure',
    ];
});

ProductAddonDelete

Executes when a product addon is being deleted.

Parameters

VariableTypeNotes
addonIdint

Response

No response supported

Example Code

<?php
add_hook('ProductAddonDelete', 1, function($vars) {
    // Perform hook code here...
});