Different content/access to each individual user

I am trying to display individual content for each individual user (not just each role).

Based on this documentation, I have tried using the code, but it is not working.

[s2If user_is(3)]Content for user with id 3[/s2If]

Is there a different way I should be handling this?

According to the [s2If /] Simple Shortcode Conditionals Documentation you should be entering the shortcode like this:

[s2If current_user_is(s2member_level3)]

Thank you. Does the current_user_is function support user IDs? I need to be able to filter by each user/member, not by each member level.

No, not in the way I think you want.

A better solution would be to write your own shortcode which could then grab the users ID and generate the content you want. That should be quite straightforward for someone to write.

1 Like

With s2Member Pro, you could have PHP in the s2If, giving you more possibilities. WP Admin > s2Member Pro > Restriction Options > Simple Shortcode Conditionals

See also: WP Admin > s2Member > API / Scripting > PHP Constants

E.g.

[s2If php="S2MEMBER_CURRENT_USER_ID == 3"]
Content for user with id 3
[/s2If]

:slight_smile: