Skip to content

Instantly share code, notes, and snippets.

@codelion7
Last active December 6, 2022 04:33
Show Gist options
  • Save codelion7/04dcfa136582f842ffa9 to your computer and use it in GitHub Desktop.
Save codelion7/04dcfa136582f842ffa9 to your computer and use it in GitHub Desktop.
Allow or Deny Lifetime Affiliate Overrides - Filterable
<?php
// Prevent overwriting existing lifetime affiliate
if ( get_user_meta( $user_id, 'affwp_lc_affiliate_id', true ) ) {
if( ! (bool) apply_filters( 'affwp_lc_update_affiliate', false, $affiliate_id, $user_id, $referral, $this->context ) ) {
return true; // Allow extensions to update lifetime affiliates
}
}
@aliefesari
Copy link

How to use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment