Wp Referral Code

Referral marketing for wordpress, slightly diferent version of this been used on TavanHub.com

ShortCodes available

[wp-referral-code var="copy_ref_link"] Shows a user friendly box to copy the refer code to the current user
[wp-referral-code var="ref_code"] Returns refer code of current user
[wp-referral-code var="ref_link"] Returns refer link specific to current user (register link + refer code)
[wp-referral-code var="invited_count"] Returns number of users current user invited (number of users who have used current users refer code)

Hooks available

Action Hook: wp_referral_code_before_refer_submitted

    /*
             * fires before refer code related information are submitted on database
             * this action wont run if ref code does'nt exist
             * passed parameters:
             * new_user_id: id of newly registered user
             * referrer_user_id: id of the user who referred newly registered user (the guy who should be rewarded :) )
             * ref_code: referral code of referrer
             * new_user_refer_codeL refer_code of newly registered user
             */
            do_action( 'wp_referral_code_before_refer_submitted', $new_user_id, $referrer_user_id, $ref_code, $new_user_ref_code );
        

Action Hook: wp_referral_code_after_refer_submitted

    /*
         * fires after refer code related information are submitted on database
         * this action wont run if ref code does'nt exist
         * passed parameters:
         * new_user_id: id of newly registered user
         * referrer_user_id: id of the user who referred newly registered user (the guy who should be rewarded :) )
         * ref_code: referral code of referrer
         * new_user_refer_codeL refer_code of newly registered user
         */
        do_action( 'wp_referral_code_after_refer_submitted', $new_user_id, $referrer_user_id, $ref_code, $new_user_ref_code );