Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active May 22, 2022 20:54
Show Gist options
  • Save amdrew/cde0ef1b2b0f23671eea to your computer and use it in GitHub Desktop.
Save amdrew/cde0ef1b2b0f23671eea to your computer and use it in GitHub Desktop.
AffiliateWP - Affiliate Info. Retrieve affiliate information via PHP function calls
<?php
$info = affiliatewp_affiliate_info()->functions;
$name = $info->get_affiliate_name();
$email = $info->get_affiliate_email();
$website = $info->get_affiliate_website();
$bio = $info->get_affiliate_bio();
$gravatar = $info->get_affiliate_gravatar();
$twitter = $info->get_twitter_username();
$facebook = $info->get_facebook_url();
$googleplus = $info->get_googleplus_url();
$username = $info->get_affiliate_username();
// Example: Show the affiliate's name
echo $name;
// Example: Only show a banner if an affiliate referred the user
if ( affiliatewp_affiliate_info()->functions->get_affiliate_id() ) {
echo 'Your site representative is ' . $name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment