Community Support Forums — WordPress® ( Users Helping Users ) — 2011-08-08T15:00:20-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14374 2011-08-08T15:00:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14374&p=30204#p30204 <![CDATA[Re: Using Replacement Codes in PHP]]>
These may be helpful:
https://codex.wordpress.org/Function_Reference/
s2Member Codex
WP Admin -> s2Member -> API / Scripting

Statistics: Posted by Cristián Lávaque — August 8th, 2011, 3:00 pm


]]>
2011-08-08T10:50:47-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14374&p=30171#p30171 <![CDATA[Re: Using Replacement Codes in PHP]]> Statistics: Posted by Bruce C — August 8th, 2011, 10:50 am


]]>
2011-08-08T05:35:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14374&p=30163#p30163 <![CDATA[Re: Using Replacement Codes in PHP]]>
I have the solution to what I was answering so thought I would share it here. I'm sure a lot of you know this but just in case, here is come php code to retrieve information about the current logged in user :

Code:
<?php
     $current_user 
wp_get_current_user();
 
    echo 
'Username: ' $current_user->user_login '<br />';
    echo 
'User email: ' $current_user->user_email '<br />';
    echo 
'User first name: ' $current_user->user_firstname '<br />';
    echo 
'User last name: ' $current_user->user_lastname '<br />';
    echo 
'User display name: ' $current_user->display_name '<br />';
    echo 
'User ID: ' $current_user->ID '<br />';
?>

Statistics: Posted by hugemonkey — August 8th, 2011, 5:35 am


]]>
2011-08-08T04:48:49-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14374&p=30162#p30162 <![CDATA[Re: Using Replacement Codes in PHP]]>
Thanks for the reply.

I will only be running these scripts on wordpress pages once someone has logged in. That should be ok shouldnt it? I do similar things in my non wordpress sites by accessing the session information to personalise the content on a per user basis.

Thanks a lot.

Statistics: Posted by hugemonkey — August 8th, 2011, 4:48 am


]]>
2011-08-07T13:10:08-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14374&p=30088#p30088 <![CDATA[Re: Using Replacement Codes in PHP]]>
I'm pretty sure, but correct me if I'm wrong that if the code if outside of the WordPress database, then it won't work, as the the shortcodes most likely link to a constant set by s2Member itself. Therefore, I would imagine that you would have to keep your idea inside of WordPress itself... or perhaps there's a way to link to it?

Statistics: Posted by Bruce C — August 7th, 2011, 1:10 pm


]]>
2011-08-07T12:04:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14374&p=30074#p30074 <![CDATA[Using Replacement Codes in PHP]]>
I was wondering if you can help me....

Is it possible to use the s2 member replacement shortcodes in php scripts? I am trying to get the current users ID so that I can feed it into another database which I will run alongside wordpress. I want to reference the entries made by a user with their ID which is assigned to them when they are added into s2 member during registration...that way I can make mysql calls to the database like SELECT * WHERE Author = %%current_user_id%% etc.

Thanks a lot for your help.

Statistics: Posted by hugemonkey — August 7th, 2011, 12:04 pm


]]>