Well, you could create a function that works like the level access shortcode for just one user.
However, if you haven’t used up all your membership levels (and don’t plan to) you could just use one for that one person, upgrade him/her to that level and then protect that content like normal.
The only issue is that member levels build on each other, meaning a level 4 member has access to all content that a level 3, 2, 1 or 0 member has. If that is a problem, then you probably will have to go the custom route.
I didn’t look throughly through the scripting/api options that s2member has, but I didn’t notice one that does this.
My quick idea is as follows:
function user_only_content($atts, $content=null){
extract( shortcode_atts( array(
'user_id' => 0,
), $atts ) );
if( is_user_logged_in() && S2MEMBER_CURRENT_USER_ID == $user_id){
return $content;
}
}
add_shortcode('user-specific-content','user_only_content');
Add that to your functions.php file in your theme.
Then to call it in your post or page, just use this:
[user-specific-content user_id="5"]
Place the content you want for user_id 5 between these tags and enter the user's id in the user_id="" in the first tag.
[/user-specific-content]
If you want to use the user’s login name instead of their ID, change this in the function:
S2MEMBER_CURRENT_USER_ID
to
S2MEMBER_CURRENT_USER_LOGIN
Then put the username/login name in the user_id=”” part of the shortcode.
Hope that helps,
Dave