Template Tags

Estimated reading: 12 minutes 1578 views

General Template Tags

%admin_email%
Category: General Category: Template Tags
 

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%
Category: General Category: Template Tags
 

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:

%badge_title%
Category: General Category: Template Tags
 

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:

%blog_info%
Category: General Category: Template Tags
 

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%
Category: General Category: Template Tags
 

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%
Category: General Category: Template Tags
 

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
%login_url_here%
Category: General Category: Template Tags
 

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%
Category: General Category: Template Tags
 

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%
Category: General Category: Template Tags

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%
Category: General Category: Template Tags
 

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%
Category: General Category: Template Tags
 

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%
Category: General Category: Template Tags
 

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.

%price%
Category: General Category: Template Tags
 

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:

%rank_image%
Category: General Category: Template Tags
 

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:

%rank_title%
Category: General Category: Template Tags
 

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:

%singular%
Category: General Category: Template Tags
 

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_name%
Category: General Category: Template Tags
 

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:

Related Template Tags

%cred_f%
Category: Amount Related Category: Template Tags
 

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

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

 

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%
Category: Amount Related Category: Template Tags
 

Navigation:

  1. Description
  2. Usage
  3. Hooks

Description

Returns the points amount without any prefix or suffix.

 

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.

Post Related Template Tags

%link_with_title%
Category: Post Related Category: Template Tags
 

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
%post_title%
Category: Post Related Category: Template Tags
 

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%
Category: Post Related Category: Template Tags
 

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%
Category: Post Related Category: Template Tags
 

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

User Related Template Tags

%balance_f%
Category: Template Tags Category: User Related
 

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%
Category: Template Tags Category: User Related
 

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
%display_name%
Category: Template Tags Category: User Related
 

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
%user_id%
Category: Template Tags Category: User Related
 

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%
Category: Template Tags Category: User Related
 

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%
Category: Template Tags Category: User Related
 

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%
Category: Template Tags Category: User Related
 

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%
Category: Template Tags Category: User Related
 

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

Comment Related Template Tags

%c_link_with_title%
Category: Comment Related Category: Template Tags
 

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%
Category: Comment Related Category: Template Tags
 

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%
Category: Comment Related Category: Template Tags
 

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%
Category: Comment Related Category: Template Tags
 

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%
Category: Comment Related Category: Template Tags
 

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 Commentsr