This action can be used to terminate or execute custom code when a new transfer request is made. This action will fire first when a user has met the core requirements for a new transfer. These core requirements are:
- The transfer recipient exists and is not excluded from getting points.
- The transfer add-on has been setup in the admin area.
- The sender has sufficient funds for this transfer.
- Class: myCRED_Transfer_Creds Method: ajax_call_transfer()
- transaction_id (string)
A unique transaction ID generated by myCRED.
- post (array)
An associative array of form fields submitted. Basically everything that got sent via $_POST after the values have been sanitized.
- prefs (array)
The transfer add-on preferences.
- transfer_addon (object)
The Transfer Module object. You can use this to access class methods like get_recipient().
- type (string)
The point type being transferred.
Remember that this action fires during an AJAX call so if you want to stop a transfer, you can use:
die( json_encode( 'myerror' ) );
If you want to add a custom transfer error / success message, please use the mycred_transfer_messages filter to add your message in clear text (what users see) and instead use the above code to return the unique error code (not visible to users).