Primary

[referrer]

This shortcode renders information about the referring affiliate, if applicable.

Pages using this shortcode should not be cached.

The shortcode is used by indicating what information about the referrer should be displayed with the display attribute. For example, to display the name of the referring affiliate:

[referrer display="name"]

Supported values for the display attribute are as follows.

a) Values taken from the affiliate entry:

  • name : as displayed in the Affiliate column under the Affiliates > Manage Affiliates section
  • id : as displayed in the Id column under Affiliates > Manage Affiliates
  • email : as displayed in the Email column under Affiliates > Manage Affiliates

b) Values taken from the user account linked to the affiliate entry:

  • user_id : the user ID (this is not the affiliate ID)
  • user_login : the username
  • user_nicename
  • user_email : the user’s email address
  • user_url : the URL of the user’s website
  • display_name : the publicly displayed name of the user

c) The field name of any enabled affiliate registration field.

  • first_name
  • last_name
  • any of the above affiliate or user fields, including user_loginuser_emailuser_url
  • any custom field added (see the example below)

Note that the password field is not allowed.

If the display attribute is omitted, the user_login of the referrer is displayed.

Example

For this example, we assume that in addition to the standard registration fields, we also have defined fields for the affiliate’s company, phone number, etc.

Registration Form Fields Example

The following example prints the referrer’s name, website, company and phone number. You can copy and paste the code below to a new page and test it after visiting an affiliate link.

[affiliates_is_referred]

You have been referred by [referrer display="name"] at [referrer display="company"].

Your referrer's website : [referrer display="user_url"] 

Your referrer's phone number : [referrer display="phone"] 

[/affiliates_is_referred]

The above example encloses the referrer information section conditionally so that it is displayed only if the viewer has actually been referred by someone.

Please note that pages using any of the referrer shortcodes must not be cached, especially if they are shown to visitors who are not logged in on your site. If those pages were cached, the same referrer information would be shown to anyone, based on the first person to visit the page which is used to create its cached version.