Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › emmeber user id php shortcode
- This topic has 14 replies, 3 voices, and was last updated 9 years, 8 months ago by wrcaccess.
-
AuthorPosts
-
February 24, 2015 at 6:41 pm #12265wrcaccessSpectator
I’d like to add member user id in php page. What’s the shortcode for it? Appreciate it.
February 24, 2015 at 9:42 pm #68747wzpModeratorFebruary 25, 2015 at 6:33 am #68748wrcaccessSpectatorI couldn’t find it. I’d appreciate if I can find a php code for
[wp_affiliate_referrer]
Many thanks!
February 25, 2015 at 1:48 pm #68749wzpModeratorI’d appreciate if I can find a php code for
[wp_affiliate_referrer]
$value = do_shortcode(‘[wp_affiliate_referrer]’);
I couldn’t find it.
You asked for something else, before.
February 25, 2015 at 3:23 pm #68750wrcaccessSpectatorYes sorry, I did. My mistake.
Can I add this code to a link?
example.com/?ref id=$value = do_shortcode(‘[wp_affiliate_referrer]’);
Is this the right format or should I enclose it with < >
Sorry, I don’t know how to do this. If you can show me…
February 25, 2015 at 4:01 pm #68751wzpModeratorYou need to “construct” the link in PHP, before it can be usable. Do you actually know how to program in PHP?
February 25, 2015 at 6:28 pm #68752wrcaccessSpectatorI use the regular shortcode on the wordpress page as
[http://www.example.com/?ref_id=[wp_affiliate_referrer]]
I’d like to append the ref short code with a php version of it.
I don’t know how to program in php, hence the request..
February 25, 2015 at 8:05 pm #68753wzpModeratorWhat exactly, big picture, are you trying to accomplish?
February 25, 2015 at 9:53 pm #68754wrcaccessSpectatorOn the php page, I want to place a ref_id link, which I can currently do on wp pages.
mysite.com/?ap_id=([wp_affiliate_referrer])
All I need is a PHP shortcode to display ([wp_affiliate_referrer]) in the correct format with the entire link as I cannot discern partial tags.
February 26, 2015 at 1:20 am #68755adminKeymasterYou can call the following function to retrieve the referrer details (if any):
wp_affiliate_get_referrer()
I don’t know how you are using it in your PHP code but the above function will only be available after the plugins have loaded. So you may need to use the plugins_loaded WordPress hook to delay the execution of your code.
February 26, 2015 at 4:22 am #68756wrcaccessSpectatorSir, can you add that function inclusive of the referral link.
wp_member has links like this
[http://www.mysite.com/?ap_id=wp_affiliate_get_referrer()]
Can you have that corrected? That is all I ask so it works on the php page.
February 26, 2015 at 11:32 pm #68757adminKeymasterI am still not sure what you are really trying to do. This is some kind of a custom stuff you are doing. You will need to go via the following route:
March 1, 2015 at 2:46 am #68758wrcaccessSpectatorAdmin, this is the confusion. All I am asking is the link below placed on a wordpress page, how can the same link be placed on a php page? I just need the wp_affiliate_get_referrer in a php version but with the entire link demonstrated so I can just cop and paste. Hopefully I am clear about this now. Many thanks!
need a php translation of the link below.
[http://www.mysite.com/?ap_id=[wp_affiliate_get_referrer]
March 1, 2015 at 4:52 pm #68759wzpModeratorI told you way back on the first page how to get the affiliate ID using PHP.
$value = do_shortcode('[wp_affiliate_referrer]');
If you want to reconstruct the complete affiliate URL then use:
$mylink='http://mysite.com?ap_id='.do_shortcode('[wp_affiliate_referrer]');
March 1, 2015 at 11:31 pm #68760wrcaccessSpectatorWZP, many thanks. thank you once again to you and admin,
-
AuthorPosts
- You must be logged in to reply to this topic.