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™

Multiple [s2If] shows higher level content

s2Member Plugin. A Membership plugin for WordPress®.

Multiple [s2If] shows higher level content

Postby vbsql7 » March 30th, 2011, 5:21 am

In a page widget I have the code below. When I log in as a level1 user, however, I see the level2 admin link:

[s2If !current_user_can(access_s2member_level1)]
This area is for Residents only.
[/s2If]
[s2If current_user_can(access_s2member_level1)]
<ul>
<li><a href="/residents-list">Residents List</a></li>
<li><a href="/facilities-information/">Facilities Info</a></li>
<li><a href="/forum">Forum</a></li>
<li><a href="/polls">Poll</a></li>
<li><a href="/my-profile">My Profile</a></li>
[s2If current_user_can(access_s2member_level2)]
<li><a href="/wp-admin/">Admin</a></li>
[/s2If]

[s2If current_user_can(access_s2member_level1)]
<li><a href="/wp-login.php?redirect_to=/resident-home">Log Out</a></li>
</ul>
[/s2If]


Thanks for any help you can provide.
Michael
User avatar
vbsql7
Registered User
Registered User
 
Posts: 8
Joined: March 29, 2011

Re: Multiple [s2If] shows higher level content

Postby benchefe » March 30th, 2011, 5:51 am

[_s2If current_user_can(access_s2member_level2)]
<li><a href="/wp-admin/">Admin</a></li>
[/_s2If]

you forgot the "_" in front of the shortcodes!

Greetings
You need music for your own website? You need an audio jingle? You need spoken words or special sounds? Let me now. I can create YOUR individual solution!
User avatar
benchefe
Experienced User
Experienced User
 
Posts: 33
Joined: February 11, 2011
Location: Hannover, Germany

Re: Multiple [s2If] shows higher level content

Postby vbsql7 » March 30th, 2011, 7:17 am

benchefe wrote:[_s2If current_user_can(access_s2member_level2)]
<li><a href="/wp-admin/">Admin</a></li>
[/_s2If]

you forgot the "_" in front of the shortcodes!

Greetings


Thank you benchefe. Turns out I didn't need the "_" because I wasn't using a nested statement... but I was missing the first end-if. Your comment helped me take a closer look. Thanks!

Michael
Michael
User avatar
vbsql7
Registered User
Registered User
 
Posts: 8
Joined: March 29, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron