WordPress Invitation Code - How To - Hide Partial Content on Page/Post
Hiding Part of The Content on Pages/Post
What Is This Feature
With the version 1.6.3 of the WordPress Invitation Code plugin, it's possible to hide parts of the content in any page, post or custom type post. Each restricted section with content can be unlocked independently from other restricted sections.
In the example below, a few parts of the text are locked - each with its own invitation code.
Two steps are necessary:
1) Code Must Have Specific Sharing Type
When creating the code, ensure its sharing type is Content Inside Page/Post.
2) Hiding Content
To actually hide the content, wrap it with the shortcode [cmicca_wrapped_content_access_code]. The shortcode has the following parameters:
- code - The comma separated list of existing codes which allow to show restricted content. This parameter must be included to the shortcode.
- view - The name of the view from the following:
- one - shows the field for entering regular invitation code (any length).
four - show the field for entering four digits invitation code.
Default value is "one".
The box for entering an invitation code will show the code name on the front-end - to give the user a hint about which code to use here.
Example of using the shortcode:
This way you can restrict different parts of the content with different invitation codes within the same page.
If you want to use the method of partial content restriction, we recommend to you to switch the option Code stays valid for to Duration of session in general plugin settings. Otherwise, users will not be able to unlock a few parts of content at the same time, as the page reloads after each time the invitation code is entered.