Functions

This article is a reference of available MLA functions which you may want to use within customizations.
Helpful tip: When using MLA and AffiliateWP functions you often need to convert between a user ID and an Affiliate ID. The following AffiliateWP functions can be used.
// Converts between a user ID and an Affiliate ID
affwp_get_affiliate_id( $user_id );
                                   
// Converts between an Affiliate ID and a user ID
affwp_get_affiliate_user_id( $affiliate_id )

mla_get_parent_id()

Returns an affiliate’s parent ID (affiliate ID) if one exists.

Arguments

mla_get_parent_id( $affiliate_id );
  • $affiliate_id (integer) (optional) An affiliate ID. Defaults to the signed in affiliate.

mla_set_parent_id()

Sets or updates an affiliate’s parent. Returns the parent ID.

Arguments

mla_set_parent_id( $affiliate_id, $parent_id );
  • $affiliate_id (integer) (optional) The affiliate ID who’s parent is to be set. Defaults to the signed in affiliate.
  • $parent_id (integer) (optional) The affiliate ID of the parent to set. Defaults to the tracked referrer first and the Default Parent (if configured) second.

mla_get_team_leader()

Returns and affiliate’s Team Leader if one exists.

Arguments

mla_get_team_leader( $affiliate_id );
  • $affiliate_id (integer) (optional) An affiliate ID. Defaults to the signed in affiliate.

mla_is_affiliate_team_leader()

Checks if an affiliate is a Team Leader. Returns (bool) True or False.

Arguments

mla_is_affiliate_team_leader( $affiliate_id );
  • $affiliate_id (integer) (optional) An affiliate ID. Defaults to the signed in affiliate.

mla_get_super_team_leader()

Returns and affiliate’s Super Team Leader if one exists.

Arguments

mla_get_super_team_leader( $affiliate_id );
  • $affiliate_id (integer) (optional) An affiliate ID. Defaults to the signed in affiliate.

mla_is_affiliate_super_team_leader()

Checks if an affiliate is a Super Team Leader. Returns (bool) True or False.

Arguments

mla_is_affiliate_super_team_leader( $affiliate_id );
  • $affiliate_id (integer) (optional) An affiliate ID. Defaults to the signed in affiliate.
Was this helpful to you?