Sometimes the basic s2Member post meta boxes are not enough to get your protections working the way they should. In this case, the easiest way to protect your content is through Conditionals.
Conditionals are something that allow you to specify which content is for which certain level or custom capability. They are available for both the free version of s2Member, and the Pro version of s2Member.
As a simple example, let's say I have two levels, levels 1 & 2, and sell access to a post through specific post/page access restrictions, and I want to show different content depending of the level of the user. For that you would use the following shortcode conditionals:
[s2If current_user_is(s2member_level2)]
Content exclusively for members level 2.
[/s2If]
[s2If current_user_is(s2member_level1)]
Content exclusively for members level 1. Maybe something saying "Upgrade now!".
[/s2If]
Now let's say I had a content that I want to be visible to everybody who can access level 1, for that you would use the following conditionals:
[s2If current_user_can(s2member_level1)]
Content for anybody who can access level 1, this includes levels 1 to 4.
[/s2If]
So as you can see, you can do many interesting combinations with shortcode conditionals. For more info on them, check under WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals.
There are also PHP versions of the conditionals, aimed at developers or advanced site owners with more advanced conditionals. You can find them under WP Admin -> s2Member -> API / Scripting -> Advanced/PHP Conditionals.







Pre-Sale FAQs
Video Tutorials
Support Forums
Knowledge Base
News / Updates
s2 Codex / Docs
GPL v2 License
Happy Customers
Private Contact
About Us
Support Policy
Privacy Policy












s2Member® (Back To Home)
Framework Plugin (Free)
s2Member® Pro (Upgrade)





