Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

WP-eMember nested content protection fo conditional content delivery

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP-eMember nested content protection fo conditional content delivery

Tagged: content protection, multiple memberships, Nesting Shortcodes, Sensei, shortcodes

  • This topic has 8 replies, 5 voices, and was last updated 2 weeks, 1 day ago by clearscopedesign.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • June 17, 2014 at 12:36 pm #11029
    FranczV
    Member

    We require content protection based on multiple membership levels with compounded access.

    For example we currently have 16 different levels to present content based on a geographic location, there are three additional variations required for each of these 16 levels, that would add extra content to each if active.

    Is it possible to nest content protection shortcodes (so Group A could have a second membership level added as a conditional so additional Group A content can be displayed) or is it possible to add conditionals to the content protection shortcode based on a custom membership field.

    We are aware that we can create Group A, Group A2, Group A3 etc. however this would require us to create 64 membership levels to achieve the desired result.

    June 17, 2014 at 2:17 pm #63748
    wzp
    Moderator

    Is it possible to nest content protection shortcodes…

    This is a WordPress (not an eMember) restriction…

    “The shortcode parser correctly deals with nested shortcode macros, provided their handler functions support it by recursively calling do_shortcode(). However the parser will fail if a shortcode macro is used to enclose another macro of the same name.”

    http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes

    …or is it possible to add conditionals to the content protection shortcode based on a custom membership field.

    Yes, eMember does support some conditional protection:

    http://www.tipsandtricks-hq.com/wordpress-membership/how-to-protect-a-section-of-a-post-or-page-88

    Perhaps that might be sufficient. If not, and depending upon the complexity, we are open to suggestions.

    June 17, 2014 at 4:50 pm #63749
    FranczV
    Member

    So based on the wordpress limitation, would it be straight forward to create a duplicate shortcode with a different name to enable nesting?

    June 17, 2014 at 10:54 pm #63750
    admin
    Keymaster

    You should be able to add secondary levels then have nested section/partial protection shortcode.

    October 7, 2014 at 3:37 pm #63751
    phytochem
    Member

    “You should be able to add secondary levels then have nested section/partial protection shortcode.”

    Could you provide an example of this?

    Thanks

    October 7, 2014 at 9:56 pm #63752
    admin
    Keymaster

    Lets say, the primary level is 1 and the secondary level is 2 in this example:

    [emember_protected for=1]

    Whatever content goes here is only visible by members who belong to level 1

    [emember_protected for=2]

    Whatever content goes here is only visible by members who belong to level 1 and level 2

    [/emember_protected]

    [/emember_protected]

    October 8, 2014 at 1:32 am #63753
    phytochem
    Member

    What is the significance and difference of that code with this (see below closing tags):

    [emember_protected for=1]

    Whatever content goes here is only visible by members who belong to level 1

    [/emember_protected]

    [emember_protected for=2]

    Whatever content goes here is only visible by members who belong to level 1 and level 2

    [/emember_protected]

    Thank you!

    October 8, 2014 at 9:56 pm #63754
    admin
    Keymaster

    The second protected block can be seen by users who have level 2 (even if they don’t have level 1).

    January 4, 2021 at 8:00 pm #82224
    clearscopedesign
    Participant

    Hi,

    We are trying to use nested content protection with shortcodes, per reply #63752 above (to make some content available only to members who have both level 1 and level 2). I copied the exact code from that reply and just changed the membership level ID’s accordingly. However, it does not seem to work for us. The second closing [/emember_protected] tag appears as text, and the content doesn’t quite get protected. Could you please help me sort out what we are doing wrong? Do we need to create a duplicate shortcode with a different name to enable nesting, as had been stated by the customer who started this thread?

    Thank you!

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Request a Plugin Update
  • Request Fresh Download Links
  • Contact Us

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • WP PDF Stamper Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Copyright © 2021 | Tips and Tricks HQ