mycred_send

Description

This shortcode allows the user viewing the shortcode to send a pre-set amount of points under a specific reference to a pre-selected user. Basically this is a very very basic transfer shortcode where the amount, recipient and log template is already set.

The shortcode can be used multiple times as long as each shortcode has it’s own reference or differ in amounts.

The shortcode will render blank in the following circumstances:

  • The user viewing it is not logged in
  • The user viewing it is excluded from the point type
  • The recipient set for the shortcode is excluded from the point type
  • The user viewing the shortcode is the recipient
  • The recipient set for the shortcode no longer exists / can not be found
  • The user viewing it does not have enough points to use the shortcode

Available since version 1.2

Shortcode Attributes

Attribute Type Required Default Description
amount int Yes - The amount to send when the button is clicked.
to string Yes - The recipient of the transfer when the button is used.
log string Yes - The log entry to be used for the transfer. The log entry is applied to both the sends and the recipients account.
ctype string No mycred_default The point type to use. Should not be used if you only have one point type installed.
ref string No "gift" The reference to use when logging the transfer. Can be used to differentiate between different type of button usages.
class string No button button-primary btn btn-primary The button classes used.

CSS Styling

// The button
input.mycred-send-points-button { }

Examples

Example 1: Create a button that will send 10 points to the post author from the current user when clicked.

[mycred_send amount=10 to="author" ref="post_like" log="Post Like"]Like Post[/mycred_send]

You could also use this shortcode to create a form of “Comment Apprechiation”. There is a tutorial on the subject for further information.