mycred_run_this
Description
This filter allows you to make adjustments to a transaction request before it is executed. If you need to stop a transaction you can set the amount to zero, however you should use the mycred_add filter to determine if a transaction should be stopped.
Available since version 1.1
Parameters
Param | Type | Required | Description |
---|---|---|---|
$request |
array | Yes | An associative array representing the transaction that is to be processed. |
$mycred |
obj | No | The myCRED_Settings class object processing the transaction request. |
Used By
Package | Prio. | Description |
---|---|---|
mycred/core | 10 | Used by the myCRED_Settings class. |
Examples
Example 1: Multiply the amount of points users gets based on their WordPress role. Administrators are excluded.
Example 2: Whenever a user on our website is to gain points, we double the value.
Example 3: Give users bonus points when they buy points using buyCRED. The amount depends on their current rank.