Your cart is currently empty!
Get affiliate info in template without shortcode
—
by
Hi,
how can i get an affiliate data, like name, username, email… to display in my template by using his affiliate id? and how can i get that data to use in a action?
couldn´t find in the documentation
thanks
Posted in Affiliates Enterprise
Comments
3 responses to “Get affiliate info in template without shortcode”
You are welcome Bruno!
Great, thank you very much!
Hi Bruno,
Since you have the affiliate id, you can use something like this snippet to display the affiliate data:
$affiliate_id = 1;
$current_user_id = affiliates_get_affiliate_user( $affiliate_id );
$current_user = get_user_by( 'ID', $current_user_id );
if ( $current_user ) {
echo 'Username: ' . $current_user->user_login . '';
echo 'User email: ' . $current_user->user_email . '';
}
The plugin API can be found here.
Kind regards,
George