- This topic has 7 replies, 2 voices, and was last updated 5 years, 1 month ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
Affiliates Management Plugin for WordPress
by
WordPress Affiliate Manager › Forums › Affiliate Manager Plugin › Shortcodes
Tagged: affiliate id, shortcode
Are there shortcodes to display user names, ids, etc. I would specifically like to display the user’s affiliate ID on a page. How would I make his happen?
I’ve tried registering a shortcode like this:
// Shortcode for User ID
function nicely_userID_shortcode() {
$nicelyUserID = $_COOKIE[‘wpam_id’];
return $nicelyUserID;
}
// register shortcode
add_shortcode(‘nicelyUserID’, ‘nicely_userID_shortcode’);
But that doesn’t seem to do the trick.
@larute, Unfortunately there is no shortcode to do this the moment. You can use this code to get the user ID of the logged-in affiliate: https://wpaffiliatemanager.com/forums/topic/get-current-logged-in-affiliate-id/
Well, I can register my own shortcode, I just need to know how to reference the Affiliate ID. I saw somewhere that you guys were using wpam_id. Is that right. I just need to find out how to return the afffiliates ID.
THank you!
@larute, “wpam_id” is just a cookie that is saved into the user’s browser when they are referred to your site by an affiliate.
Ok, can you give me the php for returning the logged in user’s affiliate ID? Then I can create my own shortcode.
Thank you!
Thank you. That is what I was looking for.