Primary

Actions

affiliates_added_affiliate

This action is invoked after a new affiliate has been added.

Parameters

$affiliate_id int The ID of the new affiliate.

affiliates_updated_affiliate

This action is invoked after an existing affiliate entry has been updated.

Parameters

$affiliate_id int The ID of the new affiliate.

affiliates_deleted_affiliate

This action is invoked after an affiliate has been marked as deleted.

Parameters

$affiliate_id int The ID of the new affiliate.

affiliates_before_setup_pages

This action is invoked before the affiliate area content is created. This happens when the page generator for the default affiliate area is used.

Parameters

This action does not provide any parameters.

affiliates_after_setup_pages

This action is invoked after the page generator has attempted to create the default affiliate area.

Parameters

$post_ids array of generated pages’ IDs

affiliates_before_register_affiliate

This action is invoked before an attempt to register a new user account for an affiliate is made. This happens when the default affiliate registration form is used.

Parameters

$userdata array containing the new user’s data including the following keys: first_name, last_name, user_login, email and user_url

affiliates_after_register_affiliate

This action is invoked after an attempt to register a new user account for an affiliate has been made. This happens when the default affiliate registration form is used.

Parameters

$userdata array of strings containing the new user’s data including the following keys: first_name, last_name, user_login, email and user_url

affiliates_stored_affiliate

This action is invoked after a new affiliate entry has been created and related to a user account. This happens when the default affiliate registration form is used.

Parameters

$affiliate_id int the new affiliate’s ID
$affiliate_user_id int the new user’s ID which is related to the affiliate entry

register_post

This WordPress action is invoked during the registration process when the default affiliate registration form is used. See register_post.

Parameters

$sanitized_user_login string
$user_email string
$errors WP_Error

affiliates_updated_referral

This action is invoked when changes to an existing referral have been registered. At least one attribute will have changed when the action is triggered.

Parameters

$referral_id int the ID of the referral that has been updated
$keys array of string indicating keys of which attributes have changed
$values array indexed by the provided keys and containing new values
$old_values array indexed by the provided keys and containing the previous values

affiliates_admin_menu

This action is invoked after the pages of the Affiliates menu have been registered.

Parameters

$pages array registered pages

affiliates_network_admin_menu

This action is invoked after the pages of the Affiliates network admin menu have been registered.

Parameters

$pages array registered pages

affiliates_updated_name

Invoked after the name of an affiliate has been changed.

Parameters

$affiliate_id int ID of the affiliate
$old_name string previous name
$name string new name

affiliates_updated_email

Invoked after the email address of an affiliate has been changed.

Parameters

$affiliate_id int ID of the affiliate
$old_email string previous email address
$email string new email address

affiliates_added_attribute

This action is invoked after an attribute has been added to an affiliate.

Parameters

$affiliate_id int ID of the affiliate
$attr_key string the key that identifies the attribute
$attr_value mixed the value of the attribute

affiliates_updated_attribute

This action is invoked after an attribute of an affiliate has been changed.

Parameters

$affiliate_id int ID of the affiliate
$key string the key that identifies the attribute
$old_value mixed the previous value of the attribute
$value mixed the new value of the attribute

affiliates_removed_attribute

This action is invoked after an affiliate’s attribute has been removed.

Parameters

$affiliate_id int ID of the affiliate
$attr_key string the key that identifies the attribute
$attr_value mixed the value of the attribute

affiliates_after_edit_affiliate_form

This action is invoked after the affiliate editing form has been output and before the attributes are rendered.

Parameters

$affiliate_id int ID of the affiliate being edited

affiliates_after_edit_affiliate_attributes

This action is invoked after the affiliate’s attributes have been rendered, when editing an affiliate.

Parameters

$affiliate_id int ID of the affiliate being edited

affiliates_referral

This action is invoked after a referral has been recorded.

Parameters

$referral_id int the unique referral ID
$params array an array containing referral details, indexed by keys as detailed below

Referral detail keys and their values:

affiliate_id int ID of the affiliate to which the referral is granted
post_id int depending on the integration, this can be the ID of the post where the referral has been generated or may indicate the transaction or order ID based on which the referral is granted
description string referral description
data array referral data (integration-dependent)
base_amount string used to calculate the referral amount
amount string referral amount
currency_id string three letter currency code
status string referral status
type string type of referral
reference string transaction reference (order ID etc.)
test boolean whether this is a test (no referrral recorded)

affiliates_added_affiliate_relation

This action is invoked after a relation between two affiliates has been established. A relation of type ‘referral’ is created when a tier between two affiliates is established, usually when one affiliate has referred a new affiliate.

Parameters

$from_affiliate_id int the ID of the affiliate from which the relation originates. In a tier relation, the one who has referred the other affiliate
$to_affiliate_id int the ID of the affiliate who is related. In a tier relation, the one who has been referred.
$relation_type string the type of relation; ‘referral’ for tier relations
$date string the date at which the relation is established

affiliates_removed_affiliate_relation

This action is invoked after a relation between affiliates has been resolved.

Parameters

$from_affiliate_id int the ID of the affiliate where the relation originates
$to_affiliate_id int the ID of the affiliate who is related

affiliates_campaigns_output

This action takes string $ouput as input and returns string the output to show.