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
Or use this API Constant to get the current User's Level #.
This code snippet can go into a Post/Page editor for WordPress.
- Code: Select all
[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LEVEL" /]
Also see this documentation:
viewtopic.php?f=40&t=9011&src_doc_v=110605#src_doc_S2MEMBER_CURRENT_USER_ACCESS_LEVEL
Another VERY useful API function is:
get_user_field()viewtopic.php?f=40&t=9015&src_doc_v=110605#src_doc_get_user_field%28%29
Or, if you just need to map a specific User ID to a specific Membership Level #, you can do this.
- Code: Select all
<?php
$user_id = 123;
$user = new WP_User($user_id);
echo c_ws_plugin__s2member_user_access::user_access_level($user);
?>
For further details, please take a look at the User Access Package:
viewtopic.php?f=40&t=9477&src_doc_v=110605