mycred_give

Codex / mycred/core / Shortcodes / mycred_give

Description

This shortcode allows you to give your users points when this shortcode is rendered. These points are created “out of thin air and not from a specific account / user. You can insert this in page/post content or in a template file.

Available since version 1.1

Shortcode Attributes

Attribute Type Required Default Description
amount int or float Yes - The amount of points to give.
user_id int or string No current user The user to receive the points. Accepts either a numeric user ID or the keyword "current" for the current user viewing the shortcode.
log string Yes - The log entry template to use when users get points.
ref string Yes "gift" The reference to log the points under.
limit int Yes 0 The maximum number of times each user can gain points from this shortcode. Use zero for unlimited.
type string No mycred_default The point type to give. Should not be used if you only have one point type installed.

CSS Styling

This shortcode does not return any stylable elements.

Example

Example 1: Give the current user 10 points for viewing this page.

[mycred_give amount="10" log="Bonus points for reading our special article" ref="bonus_points"]

Last edited June 23, 2016