Skip to content

Documentation

  1. Home
  2. Docs
  3. Referral Codes
  4. Shortcodes

Shortcodes

This documentation is for the Referral Codes plugin

Use the following shortcodes to display information about your referrals and their codes.

Summary

Referral Code Display

Shows the current user’s referral code if he has one.

[referral_code before="My code is " after=" and I have to share it."]

  • Attribute : Description
  • before : Text displayed before the code
  • after : Text displayed after the code
  • raw : If set to true, the result will be a simple text (raw=”true”). Otherwise, the result will be displayed inside a stylable element
  • um-public : Set the option to true (um-public=’true’) to make the information public on Ultimate Members profile pages

Referral URL Display

Shows the current user’s referral link if he has one.

[referral_url before="My Referral URL is " after=" and I have to share it."]

  • Attribute : Description
  • before : Text displayed before the URL
  • after : Text displayed after the URL
  • raw : If set to true, the result will be a simple text (raw=”true”). Otherwise, the result will be displayed inside a stylable element
  • um-public : Set the option to true (um-public=’true’) to make the information public on Ultimate Members profile pages

Referral Standby Amount

Referral earnings that weren’t converted into a reward yet.

[referral_standby_amount]

  • Attribute : Description
  • raw : If set to true, the result will be a simple numeric value. Otherwise, the result will be displayed as an amount with currency according to your WooCommerce settings
  • um-public : Set the option to true (um-public=’true’) to make the information public on Ultimate Members profile pages

Referral Total Amount

Sum of all received rewards amounts over a period, no matter if it was coupons or wallet money. Does not include standby amounts.

[referral_total_amount period="year"]

  • Attribute : Description
  • period : A period over which the rewards are summed up. No time limit if omitted.
    • year : Covers a year (the last floating year unless yous define a reset date)
    • month : Covers a month (the last floating month unless yous define a reset date)
  • reset : The number of periods to cover (default: 1). Ignored if the period option is omitted.
  • count : A reference date for the period to start over as “day/month”, for example reset=”01/05″ period=”year” to start over each first of May. If reset is omitted, period is floating. Without a period, sum starts at this very date.
  • raw : If set to true, the result will be a simple numeric value. Otherwise, the result will be displayed as an amount with currency according to your WooCommerce settings
  • um-public : Set the option to true (um-public=’true’) to make the information public on Ultimate Members profile pages

Referral Mask

Displays the content only if a condition is fulfilled. Shortcodes inside the content will be processed too. This shortcode is very useful as it will allow you to show content to your referrals only if they meet certain conditions. In addition, you can add other shortcodes inside that shortcode to get exactly the result you want.

[referral_mask condition="code"]My conditional content[/referral_mask]

  • Attribute : Description
  • condition : The settings to check
    • code : Displays the content only if the current user has a Referral Code defined.
    • standby : Displays the content only if the current user has a standby amount greater than zero.
    • coupon : Displays the content only if the reward settings are set to create coupons.
    • wallet : Displays the content only if the reward settings are set to add money to the virtual wallet.
  • not : (optional) Set it to true (not=”true”) to reverse the result. For example to show the content when user has no code.
  • else : (optional) A simple text to display as an alternative.
  • um-public : Set the option to true (um-public=’true’) to make the information public on Ultimate Members profile pages

Referral Code content

Displays the content only if a Referral Code is set in Cart. Shortcodes inside the content will be processed too.

[referral_is_current]My conditional content[/referral_is_current]

  • Attribute : Description
  • cmp : (optional) Test for a specific Referral Code. Omit it to test if any Referral Code is set.
  • not : (optional) Set it to true (not=”true”) to reverse the result. For example to show the content no referral set.
  • else : (optional) A simple text to display as an alternative.

Show Current Code

Show the current Referral Code currently set in Cart.

[referral_get_current]

  • Attribute : Description
  • field : (optional, default is `code`) The referral piece of information to show. Value could be `code`, `name`, `nickname`, `nicename`, `email`, `user_url`.
  • raw : (optional) If set to true, the result will be a simple text (raw=”true”). Otherwise, the result will be displayed inside a stylable element

Referral Code Edition

Let your users choose their referral code with a form.

[referral_code_editor]

  • Attribute : Description
  • role : List of comma separated roles allowed to create/edit a referral code. If ommited, all users can create a referral code.
  • myaccount : If role is ommited but this option is set to true (myaccount=’true’), role restriction will be the same as for the Referral My-Account tab.
  • um-public : Set the option to true (um-public=’true’) to make the information public on Ultimate Members profile pages

This shortcode also comes with the possibility to style the form’s appearance. Go to Referral Codes → Appearance → Shortcodes and go down until you find the styling tool.

Referral History

Referrals can see their referral transactions history.

[referral_history]

  • Attribute : Description
  • limit : The number of result per page (default is 10).
  • um-public : Set the option to true (um-public=’true’) to make the information public on Ultimate Members profile pages

Referral Coupons

Coupons List. Sorted by date.

[referral_coupons]

  • Attribute : Description
  • title : A title above the coupons list
  • status : Select the kind of coupons to list :
    • available : (default) Shows only valid coupons
    • used : Shows only alreadu used or expired coupons
  • um-public : Set the option to true (um-public=’true’) to make the information public on Ultimate Members profile pages
Scroll To Top