Shortcode Description

This shortcode will generate a html form for purchasing creds. mycred_buy_form offers far more options then the mycred_buy shortcode.

Requirements

  • myCRED 1.1 or higher.
  • The buyCRED add-on must be enabled.

Navigation

Usage in content

[mycred_buy_form]

Usage in theme files

echo do_shortcode( '[mycred_buy_form]' );

Shortcode Attributes

Attribute Type Default Required
button ( string ) empty no
The buy Button label.
Attribute Type Default Required
gateway ( string ) empty no
Option to pre-set the payment gateway to use. You can set just one gateway id or a comma separated list of ids without any space for multiple. If not set, all active gateways will be available for the user to pick from.
Attribute Type Default Required
ctype ( string ) mycred_default no
If you have multiple point types, the point type sold via this form.
Attribute Type Default Required
amount ( int|float ) empty no
Option to set the amount of points to purchase via this form. If not set, the user has to nominate the amount.
Attribute Type Default Required
gift_to ( int|string ) empty no
Option to gift purchases via this button to a specific user. Accepts either a user ID or the word author if the code is used inside The Loop.
Attribute Type Default Required
login ( string ) buyCRED Template no
Text to show when a user is not logged in.

CSS Styling

// The Form
form.myCRED-buy-form { }