Giving users points for transference
-
I’m trying to give the users points for making a transference. This snippet is working well for my default point, but how can I do the same for all my custom points?
add_filter( 'mycred_add_finished', 'mycred_give_points', 10, 2 ); function mycred_give_points( $result, $request, $mycred ) { extract( $request ); $points_to_users = 0-$amount; if ( $result === false || $request['ref'] != 'transfer' || $request['type'] == 'mycred_default' ) return $result; // Add points to users $mycred->add_creds( 'transfer', $user_id, $points_to_users, '%plural% for transference.', $ref_id, $data, 'mycred_default' ); return $result; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Giving users points for transference’ is closed to new replies.