mycred_affiliate_link

Codex / mycred/core / Shortcodes / mycred_affiliate_link

Description

Used by the Point for referrals hook, this shortcode will append the current users referral link to a given URL. If no URL is given, the current page’s URL is used.

Requires the “Points for referrals” hook to be enabled.

Available since version 1.4

Shortcode Attributes

Attribute Type Required Default Description
url string No - A specific URL that we want to append the referral code to. If not used or left empty, the URL of the page where the shortcode is used will be used.
type string No mycred_default If you are using multiple point types and the hook is enabled for more then one type, you can use this to define which point type this shortcode belongs to.

CSS Styling

This shortcode does not return any stylable elements.

Example

Example 1: Use the shortcode to present the current page's URL that users need to use in order to get points for referrals.

Earn points by sharing this page. Copy and paste the following URL:
[mycred_affiliate_link]

Example 2: Use the shortcode to present a specific URL that users need to use in order to get points for referrals.

Earn points by sharing. Copy and paste the following URL:
[mycred_affiliate_link url="https://www.merovingi.com"]

Example 3: Append the referral link directly into an anchor element.

<a href="[mycred_affiliate_link]">Click on this referral link</a>

Last edited August 15, 2016