Shortcodes
The myCred plugin comes packed with shortcodes that were built to help you present point related information to your users, on the front end of your website. Using shortcodes are voluntary, if you prefer to present information your own way, thats perfectly fine!
Anyone who can publish content on your website can potentially use myCred shortcodes! The plugin can not stop a shortcode from being inserted where it shouldn't be used, or by someone who should not be allowed to use them.
Core Shortcodes
The following list of shortcodes are available as soon as the plugin has been enabled and you have setup your first point type. No add-ons or premium plugins are required for these shortcodes to work:
[mycred_history]
- Shows the points history either for all users or for the user viewing the shortcode.
[mycred_leaderboard]
- Shows a leaderboard based on either balances or points history.
[mycred_my_ranking]
- Shows a users position in a leaderboard based on either balances or points history.
[mycred_my_balance]
- Shows either a specific users balance or the current users balance.
[mycred_send]
- Creates a button that transfers x amount of points to a pre-set recipient.
[mycred_total_balance]
- Shows the total balance of a specific user or the current user.
[mycred_hook_table]
- Shows a table with all the different way users can earn points via hooks.
[mycred_link]
- Shows a link that grants points based on your “Points for clicking on links” hook setup.
[mycred_affiliate_link]
- Shows a link with an affiliate ID attached when using the “Points for referrals” hook.
[mycred_total_points]
- Show total amount of points in circulation or total awarded / deducted by reference.
[mycred_best_user]
- Show the user with most / least points based on balance or point history.
[mycred_show_if]
- Wrap this shortcode around content you only want to show to users that have a certain amount of points and / or rank (if used).
[mycred_hide_if]
- Wrap this shortcode around content you want to hide from users that have a certain amount of points and / or rank (if used).
[mycred_total_since]
- Shows the total amount of points a user has gained since a particular time e.g. this today.
[mycred_video]
- Embeds a YouTube video that grants points based on your “Points for viewing videos” hook setup.
Add-on Shortcodes
The following shortcodes are provided by the built-in myCred add-ons and requires that you enable the appropriate add-on in order to gain access to the shortcodes.
[mycred_buy]
- Allows you to sell a specific amount of points using a specific gateway.
[mycred_email_subscriptions]
- Shows the subscriptions options which allows users to select the email notifications they wish to receive.
[mycred_content_sale_count]
- Show the number of times the content has been purchased for a given post.
[mycred_content_buyer_count]
- Shows the number of unique users that has purchased a given post.
[mycred_content_buyer_avatars]
- Shows a list of avatars of users who have purchased a given post.