It’s a client portal, not very complex but some content must be accessible to only specific user. I’ve been reading the doc and found this :
Simple Conditionals (via WordPress Shortcodes)
In an effort to give you even more control over access restrictions, s2Member makes Simple Conditionals available to you from within WordPress, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress. In this section, we’ll demonstrate several functions that are possible using Shortcodes:
is_user_logged_in(), is_user_not_logged_in(), user_is(user_id, role), user_is_not(user_id, role), user_can(user_id, capability), user_cannot(user_id, capability), current_user_is(role), current_user_is_not(role), current_user_can(capability), current_user_cannot(capability), current_user_is_for_blog(blog_id,role), current_user_is_not_for_blog(blog_id,role), current_user_can_for_blog(blog_id,capability), current_user_cannot_for_blog(blog_id,capability). To make use of these functions, please follow our code samples below. Using Shortcodes, it’s easy to build Simple Conditionals within your content; based on a Member’s Level, or even based on Custom Capabilities. s2Member’s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.
There are two different Shortcodes being demonstrated here:
- s2If (for testing simple conditional expressions).
- s2Get (to get an API Constant value, a Custom Field, or meta key)
But I did try to use this : [s2If user_is(5, member)]My content for user number 5 [/s2If]
but this functions does not work. Maybe I’m missing something or misunderstanding ?