Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Shortcode protection breaks page protection
Tagged: protection shortcode
- This topic has 4 replies, 3 voices, and was last updated 5 years, 4 months ago by clearscopedesign.
-
AuthorPosts
-
June 18, 2014 at 12:21 am #11036DebraReedMember
I could not find anything that said not to do this so I assumed it would work.
1. I protected a page by ticking the option at the bottom of the page editor (Yes, Protect this content. Free Level 2.)
2. I then wanted to further protect a section of the page content according to additional member levels using [emember_protected for=4-5-6-8-9 do_not_show_restricted_msg=1][/emember_protected]
What happens is that the partial protection works as expected, but the rest of the page is now unprotected … non-logged in users can view the page.
Are these two ways of protection supposed to work together in the way I attempted?
Did I do something wrong?
Or do I need to stick to just one method of protection within a page?
Thanks!
June 18, 2014 at 12:41 am #63767adminKeymasterYou have no reason to use the full page content protection option of that page if you are going to use section protection in it.
Section protection shortcode allows you to protect whatever section(s) you want to protect in that page.
You can use as many section protection blocks as you want in that page (for any access levels).
June 18, 2014 at 2:29 am #63768DebraReedMemberI was trying to avoid multiple sections of shortcode. Instead, I was hoping to protect the whole page by the free level and then just use one section of shortcode to protect that one piece of content. Instead, I will need to use three sections of shortcode … protect the top for free level, the middle for particular other levels, and the bottom for free level.
I know the multiple sections of shortcode will work, just thought maybe I was missing something and could make what I was doing work instead.
Thanks for your help!
August 17, 2019 at 3:21 am #63769clearscopedesignParticipantWe have just encountered this same issue.
There absolutely can be a need to use full page protection on pages that also uses section protection, contrary to the assertion above.
For example, we have several member pages that have some content that is available to all members, and then that also have several different content sections that are available to different membership levels.
For the content that is available to all members, it would be much easier to just be able to protect the entire page, rather than having to use multiple [emember_protected scope=”verified_users_only”] shortcodes for those areas of content. It is not very intuitive for the page protection to break just because the section protection is also used.
However, beyond that, what is the bigger issue is that if a logged-out user visits the page, they then see numerous protection messages displayed, for each of the different sections that are protected by a shortcode, rather than the single “Please Login to view this content” message.
This is really not ideal. For logged-out users there should only appear the single “Please Login to view this content” message, as per usual for all the other member pages that are protected at the page level.
Is it possible for you to fix this issue, so that the full page protection will not break when shortcode protection is used on the page?
Or, at the very least, some sort of workaround to fix the issue of having all the different protection messages for all the different shortcode sections appearing for logged-out users?
August 17, 2019 at 5:51 am #63770clearscopedesignParticipantOk we have figured out that we can get the page to not display the multiple content protection messages by using the do_not_show_restricted_msg=”1″ parameter on those sections.
So this functionally solves our main issue and allows us to display a single “Please Login to view this content” message for logged-out users, without the additional protected content messages.
However this means that we can’t display the protected content messages for the various sections for logged-in users.
Is there a way to display the protected content message for a shortcode protected section only for logged-in users, and not for logged-out users?
Also it would still seem much simpler and more intuitive for the page protection to still work properly when shortcode protection is used on the page, and to not break that way.
-
AuthorPosts
- You must be logged in to reply to this topic.