Page 1 of 1

call member email in form field

PostPosted: December 3rd, 2011, 10:08 pm
by antseo
What is the code (either php or s2member short code) to add in a member's email address that is logged into the site? I want place it in a form field in another plugin.

Re: call member email in form field

PostPosted: December 4th, 2011, 2:43 am
by Cristián Lávaque
Try S2MEMBER_CURRENT_USER_EMAIL. WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_EMAIL

S2MEMBER_CURRENT_USER_EMAIL
This will always be a (string) containing the current User's Email Address. Empty if not logged in.

<?php echo S2MEMBER_CURRENT_USER_EMAIL; ?>
This may output something like: johnsmith@example.com
( or whatever their email address is )

---- s2member Shortcode Equivalent ----

[s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /]


I hope it helps. :)