Display Membership Level
Posted:
June 10th, 2011, 11:56 am
by startasocialnetwork
I'm trying to figure out how to display someone's Membership Level along with their profile, like many forums (including this one: "Registered User" or "Support Rep." for Cristian) do.
I know the shortcode to display a member's level to themselves, but how can I display someone's level for all members to see? I'd want it to match the names assigned through s2Member...
Re: Display Membership Level
Posted:
June 14th, 2011, 12:17 am
by Jason Caldwell
Thanks for the excellent question.You can use this API Constant to get the current User's Membership Level Label.
This code snippet can go into a Post/Page editor for WordPress.
- Code: Select all
[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]
Also see this documentation:
viewtopic.php?f=40&t=9011&src_doc_v=110605#src_doc_S2MEMBER_CURRENT_USER_ACCESS_LABEL
Re: Display Membership Level
Posted:
June 14th, 2011, 12:44 am
by Cristián Lávaque
Jason, I think he's trying to get the label for users that aren't the current one, so I'll quote what you explained in the other thread:
- Code: Select all
$user_label = c_ws_plugin__s2member_user_access::user_access_label($user_id);
viewtopic.php?f=40&t=9477&src_doc_v=110605#src_doc_user_access_label%28%29I hope that helps.