Thank you VERY much for the followup.
Watch out using
$current_user->user_levelThat is NOT the s2Member Level. It's a deprecated WP level, no longer used.
$current_user->user_level = the WordPress level, NOT the same thing as the s2Member Level.
$current_user->user_level is part of the WP core, and it's deprecated as of WP 2.8.
- that property will eventually be removed completely, in favor of capabilities.
So, if what you're really asking is.... Does the Member have an s2Member Level > 1, you would do this:
- Code: Select all
if(current_user_can("access_s2member_level2"))
{
// Yes, the Member can at least access Levels 2, 1, and 0.
}
Or this:
- Code: Select all
if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL > 1)
{
// Yes, the Member can at least access Levels 2, 1, and 0.
}
I know you already know this, but I'm tagging this on for anyone else reading this.
Membership Levels provide incremental access:* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 & 3.
* A Member with Level 3 access, will also be able to access Levels 0, 1 & 2.
* A Member with Level 2 access, will also be able to access Levels 0 & 1.
* A Member with Level 1 access, will also be able to access Level 0.
* A Subscriber with Level 0 access, will ONLY be able to access Level 0.
* WordPress® Subscribers are at Membership Level 0. If you're allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ).
* WordPress® Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.