Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Adjust Transfers
- * Will change the points to be charged for the transfer
- * to the custom point type "my_custom_type" and deposit
- * the same amount into the senders account in the original
- * point type.
- * @version 1.0
- */
- add_filter( 'mycred_run_this', 'mycred_pro_payout_on_transfer', 10, 2 );
- function mycred_pro_payout_on_transfer( $request, $mycred ) {
- extract( $request );
- if ( $ref != 'transfer' || ( $ref == 'transfer' && $amount > 0 ) ) return $request;
- $request['type'] = 'my_custom_type';
- $mycred->update_balance( $user_id, $amount, $type );
- $mycred->add_to_log(
- $ref,
- $user_id,
- abs( $amount ),
- $entry,
- $ref_id,
- $data,
- $type
- );
- return $request;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement