A free points management plugin for WordPress.
myCRED Logo
myCRED Logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download
    Categories
    Filter by category
    1. Actions
    2. Classes
    3. Filters
    4. Functions
    5. Hooks
    6. Objects
    7. Shortcodes
    8. Template Tags
    Chapters
    Documentation
    1. Chapter I - Introduction
    2. Chapter II - Getting Started
    3. Chapter III - Add-ons
    4. Chapter IV - Premium Add-ons
    5. Chapter V - For Developers
    6. Chapter VI - Reference Guides
Category: Template Tags

Codex / Template Tags

%admin_email%Tag

This template tag returns your websites’ email address.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

This template tag returns your websites’ email address. This is the email address used on the General Settings page in WordPress. Added in version 1.1

 

Usage

Email Notices

This email was sent from %blog_name% - %site_info%

Output

This email was sent from myCRED - a free WordPress points management plugin

 

Hooks

This template tag can be used in any hook that accepts General template tags.

 

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%badge_image%Tag

This template tag returns your websites’ email address.

Navigation:

  1. Description
  2. Add-ons

Description

This template tag returns the badge image that the user has achieved.

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%badge_title%Tag

This template tag returns your websites’ email address.

Navigation:

  1. Description
  2. Add-ons

Description

This template tag returns the badge title that the user has awarded.

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%balance_f%Tag

This template tag returns the current balance of the user, formatted with prefix and/or suffix.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

This template tag returns the current balance of the user, formatted with prefix and/or suffix. To return the balance unformated consider using the %balance% template tag. Added in version 1.1

 

Usage

Email Notices

Your current points balance is %balance_f%.

Output

Your current points balance is 1,200.00 $pt.

 

Hooks

This template tag can be used in any hook that accepts User related template tags.

 

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%balance%Tag

This template tag returns the current balance of the user, unformatted.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

This template tag returns the current balance of the user, unformatted. To return the balance formated consider using the %balance_f% template tag. Added in version 1.1

 

Usage

Email Notices

Your current points balance is %balance%.

Output

Your current points balance is 1200.

 

Hooks

This template tag can be used in any hook that accepts User related template tags.

 

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%blog_info%Tag

This template tag returns your websites’ tagline.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

This template tag returns your websites’ tagline. Returns an empty string if tagline is not used. Added in version 1.1

 

Usage

Email Notices

This email was sent from %blog_name% - %site_info%

Output

This email was sent from myCRED - a free WordPress points management plugin

 

Hooks

This template tag can be used in any hook that accepts General template tags.

 

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%blog_name%Tag

This template tag returns your websites’ name.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

This template tag returns your websites’ name. Added in version 1.1

 

Usage

Email Notices

This email was sent from %blog_name%

Output

This email was sent from myCRED

 

Hooks

This template tag can be used in any hook that accepts General template tags.

 

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%blog_url%Tag

This template tag returns your websites’ URL.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

This template tag returns your websites’ URL. Added in version 1.1

 

Usage

Email Notices

This email was sent from <a href="%blog_url%">%blog_name%</a>

Output

This email was sent from <a href="http://mycred.me">myCRED</a>

 

Hooks

This template tag can be used in any hook that accepts General template tags.

 

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%c_link_with_title%Tag

Returns the post title wrapped in the posts permalink for where the comment was made.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the post title wrapped in the posts permalink for where the comment was made.

 

Usage

Log Template

Points for new comment on: %c_link_with_title%

Output

Points for new comment on: <a href="http://address.com/a-new-post/">A new post</a>

 

Hooks

This template tag can be used in the following hooks:

  • Points for Comments
%c_post_id%Tag

Returns the post id where the comment was made.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the post id where the comment was made.

 

Usage

Log Template

Points for new comment on: <a href="http://address.com/?post=%c_post_id%">%c_post_title%</a>

Output

Points for new comment on: <a href="http://address.com/?post=123">A New Post</a>

 

Hooks

This template tag can be used in the following hooks:

  • Points for Comments
%c_post_title%Tag

Returns the post title where the comment was made in plain text format.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the post title where the comment was made in plain text format.

 

Usage

Log Template

Points for new comment on: %c_post_title%

Output

Points for new comment on: A new post

 

Hooks

This template tag can be used in the following hooks:

  • Points for Comments
%c_post_url%Tag

Returns the post url where the comment was made, to be used in an anchor element.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the post url where the comment was made, to be used in an anchor element.

 

Usage

Log Template

Points for new comment on: <a href="%post_url%/#%comment_id%">view comment</a>

Output

Points for new comment on: <a href="http://address.com/a-new-post/#123">view comment</a>

 

Hooks

This template tag can be used in the following hooks:

  • Points for Comments
%comment_id%Tag

Returns the comment id.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the comment id.

 

Usage

Log Template

Points for new comment #%comment_id%

Output

Points for new comment #123

 

Hooks

This template tag can be used in the following hooks:

  • Points for Comments
%cred_f%Tag

Returns the points amount formated with prefix and/or surffix.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the points amount formated with prefix and/or surffix.

Usage

Log Template

%cred_f% %_plural% penalty.

Output

5 Points penalty.

Hooks

This template tag can be used in all hooks.

Shortcodes

This template tag can be used in the mycred_leaderboard shortcode.

%cred%Tag

Returns the points amount without any prefix or surffix.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the points amount without any prefix or surffix.

 

Usage

Log Template

%cred% %_plural% penalty.

Output

5 Points penalty.

 

Hooks

This template tag can be used in all hooks.

Shortcodes

This template tag can be used in the mycred_leaderboard shortcode.

%display_name%Tag

Returns the users display name.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the users display name.

 

Usage

Log Template

Points for becoming friends with %display_name%

Output

Points for becoming friends with John Doe

 

Hooks

This template tag can be used in the following hooks:

  • Points for Registration
  • BuddyPress: Members

 

Add-ons

This template tag can be used with the following add-ons:

  • Transfer
%gateway%Tag

Returns the payment gateway used when purchasing points using the buyCRED add-on.

Navigation:

  1. Description
  2. Usage

Description

Returns the payment gateway used when purchasing points using the buyCRED add-on.

Note! Requires myCRED 1.0.8 or higher.

 

Usage

buyCRED Purchase Log Template

%plural% purchase using %gateway%

Output

Points purchase using PayPal
%link_with_title%Tag

Returns the post title wrapped in the posts permalink.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the post title wrapped in the posts permalink.

 

Usage

Log Template

Points for new post: %link_with_title%

Output

Points for new post: <a href="http://address.com/a-new-post/">A new post</a>

 

Hooks

This template tag can be used in the following hooks:

  • Points for Publishing Content
  • Contact Form 7 Form Submissions
  • bbPress 2.0
  • BuddyPress: Groups
%login_url_here%Tag

Returns the login URL with a redirection to the current page, to be used in HTML elements.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the login url with a redirection to the current page, to be used in HTML elements.

 

Usage

<a href="%login_url_here%" title="Click to Login">Login & Return</a>

 

Hooks

This template tag can be used in all hooks.

 

Add-ons

This template tag can be used with all add-ons.

%login_url%Tag

Returns the login URL without any redirection, to be used in HTML elements.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the login url without any redirection, to be used in HTML elements.

 

Usage

<a href="%login_url%" title="Click to Login">Login</a>

 

Hooks

This template tag can be used in all hooks.

 

Add-ons

This template tag can be used with all add-ons.

%logout_url_here%Tag

Returns the logout URL with redirection to the current page, to be used in HTML elements.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the logout url with redirection to the current page, to be used in HTML elements.

 

Usage

<a href="%logout_url_here%" title="Click to Logout">Logout & Return</a>

 

Hooks

This template tag can be used in all hooks.

 

Add-ons

This template tag can be used with all add-ons.

%logout_url%Tag

Returns the logout url without any redirection, to be used in HTML elements.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the logout url without any redirection, to be used in HTML elements.

 

Usage

<a href="%logout_url%" title="Click to Logout">Logout</a>

 

Hooks

This template tag can be used in all hooks.

 

Add-ons

This template tag can be used with all add-ons.

%num_members%Tag

This template tag returns the total number of registered members on your website.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

This template tag returns the total number of registered members on your website. Added in version 1.1

 

Usage

Email Notices

This email was sent from %blog_name% - %site_info%

Output

This email was sent from myCRED - a free WordPress points management plugin

 

Hooks

This template tag can be used in any hook that accepts General template tags.

 

Add-ons

This template tag can be used with the following add-ons:

  • Email Notices
%plural%Tag

Template tag returning the name of your points in plural form. For example: Points, Tokens, Credits. Adding an underscore at the beginning will return the name in lowercase.

Navigation:

  1. Description
  2. Usage
  3. Examples
  4. Hooks
  5. Add-ons

Description

Template tag returning the name of your points in plural form. For example: Points, Tokens, Credits. Adding an underscore at the beginning will return the name in lowercase.

 

Usage

%plural% or %_plural%

 

Examples

Example 1: Buy %_plural% now!

Buy tokens now!

Example 2: 10 %plural% for sending an invite.

10 Tokens for sending an invite.

 

Hooks

This template tag can be used in all hooks.

 

Add-ons

This template tag can be used with all add-ons.

%post_title%Tag

Returns the post title in plain text format.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the post title in plain text format.

 

Usage

Log Template

Points for new post: %post_title%

Output

Points for new post: A new post

 

Hooks

This template tag can be used in the following hooks:

  • Points for Publishing Content
  • Contact Form 7 Form Submissions
  • bbPress 2.0
  • BuddyPress: Groups
%post_type%Tag

Returns the post type’s singular name.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the post type’s singular name.

 

Usage

Log Template

Points for new %post_type%

Output

Points for new Page

 

Hooks

This template tag can be used in the following hooks:

  • Points for Publishing Content
  • Contact Form 7 Form Submissions
  • bbPress 2.0
  • BuddyPress: Groups
%post_url%Tag

Returns the post url to be used in an anchor element.

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the post url to be used in an anchor element.

 

Usage

Log Template

Points for new post: <a href="%post_url%">%post_title%</a>

Output

Points for new post: <a href="http://address.com/a-new-post/">A new post</a>

 

Hooks

This template tag can be used in the following hooks:

  • Points for Publishing Content
  • Contact Form 7 Form Submissions
  • bbPress 2.0
  • BuddyPress: Groups
%price%Tag

This template tag returns your websites’ email address.

Navigation:

  1. Description
  2. Add-ons

Description

This template tag returns the amount that the user has determined to settings.

Add-ons

This template tag can be used with the following add-on:

  • Sell Content
%rank_image%Tag

This template tag returns your websites’ email address.

Navigation:

  1. Description
  2. Add-ons

Description

This template tag returns the rank image that the user has achieved.

Add-ons

This template tag can be used with the following add-ons:

  • Email Notification
%rank_title%Tag

This template tag returns your websites’ email address.

Navigation:

  1. Description
  2. Add-ons

Description

This template tag returns the rank title that the user has awarded.

Add-ons

This template tag can be used with the following add-ons:

  • Email Notification
%singular%Tag

Template tag returning the name of your points in singular form. For example: Point, Token, Credit etc.

Navigation:

  1. Description
  2. Usage
  3. Examples
  4. Hooks
  5. Add-ons

Description

Template tag returning the name of your points in singular form. For example: Point, Token, Credit etc. Adding an underscore at the beginning will return the name in lowercase.

 

Usage

%singular% or %_singular%

 

Examples

Example 1: Earn yourself a %_singular%!

Earn yourself a token!

Example 2: %singular% for logging in.

Token for logging in.

 

Hooks

This template tag can be used in all hooks.

 

Add-ons

This template tag can be used with all add-ons.

%user_id%Tag

Returns the users id.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the users id.

 

Usage

Log Template

Points for new friend: %display_name% ID: %user_id%

Output

Points for new friend: John Doe ID: 2

 

Hooks

This template tag can be used in the following hooks:

  • Points for Registration
  • BuddyPress: Members

 

Add-ons

This template tag can be used with the following add-ons:

  • Transfer
%user_name_ec%Tag

Returns the users “user name” URL encoded.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the users “user name” URL encoded. If you want to return the username in plain format you can use the %user_name% template tag instead.

 

Usage

Log Template

Points for becoming friends with <a href="http://address.com/members/%user_name_ec%/" title="View Profile">%display_name%</a>

Output

Points for becoming friends with <a href="http://address.com/members/john%20doe/" title="View Profile">John Doe</a>

 

Hooks

This template tag can be used in the following hooks:

  • Points for Registration
  • BuddyPress: Members

 

Add-ons

This template tag can be used with the following add-ons:

  • Transfer
%user_name%Tag

This template tag returns your websites’ email address.

Navigation:

  1. Description
  2. Hook

Description

This template tag returns the amount that the user has determined to settings.

Hook

This template tag can be used with the referral hook:

  • Referral
%user_name%Tag

Returns the users “user name”.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the users “user name”. If you want to return the username URL encoded you can use the %user_name_ec% template tag instead.

 

Usage

Log Template

Points for becoming friends with %user_name%

Output

Points for becoming friends with john doe

 

Hooks

This template tag can be used in the following hooks:

  • Points for Registration
  • BuddyPress: Members

 

Add-ons

This template tag can be used with the following add-ons:

  • Transfer
%user_profile_link%Tag

Returns the link to the users profile page with their display name as title.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the link to the users profile page with their display name as title.

 

Usage

Log Template

Points for becoming friends with %user_profile_link%

Output

Points for becoming friends with <a href="http://address.com/members/john%20doe/">John Doe</a>

 

Hooks

This template tag can be used in the following hooks:

  • Points for Registration
  • BuddyPress: Members

 

Add-ons

This template tag can be used with the following add-ons:

  • Transfer
%user_profile_url%Tag

Returns the users profile url to be used in an anchor element.

Navigation:

  1. Description
  2. Usage
  3. Hooks
  4. Add-ons

Description

Returns the users profile url to be used in an anchor element.

 

Usage

Log Template

Points for becoming friends with <a href="%user_profile_url%" title="View Profile">%display_name%</a>

Output

Points for becoming friends with <a href="http://address.com/members/john%20doe/" title="View Profile">John Doe</a>

 

Hooks

This template tag can be used in the following hooks:

  • Points for Registration
  • BuddyPress: Members

 

Add-ons

This template tag can be used with the following add-ons:

  • Transfer

About myCRED

myCRED is a free, open-source and developer friendly points management tool for WordPress powered websites.

Download Rate Plugin

Documentation

  • Add-ons
  • Core Shortcodes
  • F.A.Q.
  • Tutorials
  • Third Party Plugins
  • Code Snippets

Support

  • Product Licenses
  • Customization
  • Support Forums
  • Plugin Changelog
  • Contact

Copyright 2013 - 2022 byWPExperts; All rights reserved. myCRED is licensed under GPL 2.0

Terms & Conditions • Use of Cookies • Store Policy • Community Rules

Suggest Codex Example

You can submit suggestions for codex examples that you have available as a public gist. If you are a member on the mycred.me website, you can earn Tokens for each submission. To claim these Tokens, make sure you provide your mycred.me username.

Please make sure the example you submit is relevant and if you include documentation, it's provided in English.

logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download