Created
November 16, 2014 23:48
-
-
Save amdrew/978267209a8cd0d4d3cd to your computer and use it in GitHub Desktop.
AffiliateWP - disable affiliate to affiliate referrals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function affwp_custom_disable_affiliate_to_affiliate_referrals( $referral_amount, $affiliate_id, $amount, $reference, $product_id ) { | |
| // affwp_is_affiliate() will check if the currently logged in user is an affilaite. | |
| // if they are an affiliate, set the referral amount to 0.00 | |
| if ( affwp_is_affiliate() ) { | |
| $referral_amount = 0.00; | |
| } | |
| return $referral_amount; | |
| } | |
| add_filter( 'affwp_calc_referral_amount', 'affwp_custom_disable_affiliate_to_affiliate_referrals', 10, 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment