Primary

Actions

Action Reference for the Affiliates plugin.

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_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)