mycred_transfer_acc_limit

Codex / mycred/transfer / Filters / mycred_transfer_acc_limit

Navigation:

  1. Description
  2. Used By
  3. Parameters
  4. Example

Description

By default a user can not transfer points if their balance is zero. You can change this though this filter allowing for users to go minus.

Note! Requires myCRED 1.0.8 or higher.

Used By

  • Function: mycred_user_can_transfer()

Parameters

  • amount (int|float)
    The amount to check against. If a users balance is lower or equal to this value, the transfer add-on will decline the transaction. Defaults to zero.
  • type (string)
    The point type being transferred. Added in 1.5.
  • user_id (int)
    The ID of the user making the transfer (the sender). Added in 1.6.2.
  • ref (string)
    The reference used for the transfer. Added in 1.6.2.

Example

Example: Allow users accounts to go minus 100 when transferring points.

add_filter( 'mycred_transfer_acc_limit', 'adjust_transfer_account_limit' );
function adjust_transfer_account_limit()
{
	return 0-100;
}

The above code goes in your themes functions.php file.

Last edited June 26, 2016