latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Shortcode to protect content

Home Forums Community Forum Shortcode to protect content

This topic contains 1 reply, has 2 voices. Last updated by  Raam Dev 4 years, 2 months ago.

Topic Author Topic
Posted: Wednesday Oct 17th, 2012 at 6:23 pm #28769

Hello,
do you support a shortcode for specific user content like

[user_is=john]

content for john only

[/user_is]

Thank you for support!

Andreas

  • This topic was modified 4 years, 2 months ago by  Raam Dev. Reason: Moved to Community Forum (not pre-sale question)
  • This topic was modified 4 years, 2 months ago by  Raam Dev. Reason: Accidentally moved; corrected and moved back to Pre-Sales forum

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Oct 18th, 2012 at 6:00 pm #28917
Raam Dev
Username: Raam
Staff Member

Hi Andreas,

Yes, s2Member can certainly handle that, however there is no shortcode. You will need to use the Advanced PHP Conditionals (see Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals). You can also use the s2Member PHP Constants for this (see Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants). Since you will be running a snippet of raw PHP in your post/page, you’ll need to install the Exec-PHP Plugin first.

Here’s what an example of what the code might look like:

<?php if (S2MEMBER_CURRENT_USER_LOGIN == "john") { ?>
    Content for user with the username 'john' goes here.
<?php } ?>
Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.