Last active
March 31, 2022 20:19
-
-
Save codelion7/08dc0380605ddedd1a4ca0e40d907362 to your computer and use it in GitHub Desktop.
Add Affiliate URL to Sub Affiliate Data in Tree View
This file contains 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
// Run if AffiliateWP MLM is Active | |
if ( class_exists( 'AffiliateWP_Multi_Level_Marketing' ) ) { | |
/** | |
* Adds Affiliate URL to Affiliate Data from the Sub Affiliates Tooltip (Downline Only) | |
* | |
* @since 1.1.6 | |
* @return array | |
*/ | |
function affwp_mlm_add_url_aff_data( $aff_data = array(), $affiliate_id = 0, $disabled_aff_data = array() ) { | |
if ( empty( $affiliate_id ) ) return $aff_data; | |
if ( isset( $disabled_aff_data['info'] ) ) return $aff_data; | |
$aff_url = esc_url( urldecode( affwp_get_affiliate_referral_url( array( 'affiliate_id' => $affiliate_id ) ) ) ); | |
$aff_data['info']['content']['url'] = $aff_url; | |
return $aff_data; | |
} | |
add_filter( 'affwp_mlm_aff_data', 'affwp_mlm_add_url_aff_data', 10, 2 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Run if AffiliateWP MLM is Active
if ( class_exists( 'AffiliateWP_Multi_Level_Marketing' ) ) {
}