Skip to content

Instantly share code, notes, and snippets.

@amdrew
Created November 16, 2014 23:48
Show Gist options
  • Select an option

  • Save amdrew/978267209a8cd0d4d3cd to your computer and use it in GitHub Desktop.

Select an option

Save amdrew/978267209a8cd0d4d3cd to your computer and use it in GitHub Desktop.
AffiliateWP - disable affiliate to affiliate referrals
<?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