mycred_format_creds
Description
This filter allows you to make adjustments to points before they are rendered on your website. If your point type is setup to use a prefix or suffix, these will be attached to the balance when passed through this filter.
Besides the myCRED_Settings class, this filter is also triggered by the AffiliateWP Hook.
Available since version 1.0
Parameters
Param | Type | Required | Description |
---|---|---|---|
$points |
string | Yes | The point amount rendered with prefix / suffix (if used). |
$amount |
int or float | No | The original amount before it was formatted. |
$mycred |
obj | No | The myCRED_Settings class object. |
Used By
Package | Prio. | Description |
---|---|---|
Not used by any built-in package. |
Examples
Example 1: Since prefixes and suffixes can not contain HTML in your settings, lets add a FontAwesome icon as a prefix to points before they are rendered.
Example 2: Adjust the layout of how our custom point type is presented. In this example, we present it as US Dollars with two decimals. Default point type is rendered as is.