mycred_affiliate_id

Codex / mycred/core / Shortcodes / mycred_affiliate_id

Description

This shortcode is used by the “Points for referrals” hook which allows your users to gain points for referring visitors and/or signups. This shortcode will return the unique referral ID of the user who views the shortcode. If the user is excluded from using myCRED or the particular point type or if the shortcode is viewed by a visitor this shortcode will return an empty string.

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

Available since version 1.4

Shortcode Attributes

Attribute Type Required Default Description
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: Insert a users referral ID into a sentence.

To earn points for referring visitors to our website simply append your referral ID to any website URL. Example: http://mywebsite.com/?mref=[mycred_affiliate_id]

Last edited June 23, 2016