PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Display custom profile fields?

s2Member Plugin. A Membership plugin for WordPress®.

Display custom profile fields?

Postby boldplans » January 21st, 2012, 4:04 am

SO I understand that we can set up profile fields for intake during the registration process and also when a user edits their S2M profile. But how can you display those fields on pages? For example, I have a field that displays a users Google Plus page. How can I simply retrieve a post author's entry for their Google Plus page? I don't see how to do this.

With Wordpress standard fields, this is much simpler. In fact, you can create additional profile fields by making an edit in the core Wordpress code (or use a plugin) and then when all the Authors of a site are output, the loop will be able to output all of their basic profile information (such as the basic AIM and Yahoo fields that are stock Wordpress.)

I only was able to find a convoluted hack which, if true, would make profile fields of limited value. While I like users to have a profile page, there is no way to have that same information appear in an author bio that appears on post pages. Hopefully all of this is not that difficult.

In addition - does S2 store IP Address information for each registered user such as the IP address they regiestered from? I see some indication in S2M that it does, perhaps storing it in each blog instead of once in the primary user table. It appears that Wordpress does not do this and it should for numerous reasons.
User avatar
boldplans
Registered User
Registered User
 
Posts: 31
Joined: January 9, 2012

Re: Display custom profile fields?

Postby Raam Dev » January 23rd, 2012, 5:56 pm

Please see WP Admin -> s2Member -> API/Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_FIELDS. You can retrieve any of the custom fields through the examples shown there.

For example, to retrieve a custom field called googleplus, you might do this:

Code: Select all
<?php $fields json_decode(S2MEMBER_CURRENT_USER_FIELDStrue); ?>
<?php 
echo $fields["googleplus"]; ?>
This would output the value of the Custom Field 'googleplus'.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Display custom profile fields?

Postby boldplans » January 23rd, 2012, 7:05 pm

Awesome Raam - thanks so much for the great support.
User avatar
boldplans
Registered User
Registered User
 
Posts: 31
Joined: January 9, 2012

Re: Display custom profile fields?

Postby Raam Dev » January 24th, 2012, 11:58 pm

You're most welcome! :)
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 2 guests

cron