mbr_not_allowed_access
Usage
This shortcode determines the content to be included based upon whether the visitor has access to a specified page/post.
It has many use cases and can be particularly useful when used in conjunction with [mbr_page]/[mbr_post] to combine various content elements into a another page/post.
Parameters
Parameters | Description |
---|---|
post_id | The page or post ID for which to check the current visitor's access conditions. Default: Current page/post post_id. Required: no. |
limit_else | If set to "yes" and the user is not logged in or does not have any ActiveCampaign contact tags that define a membership as selected in ActiveMember360, Settings, Memberships this parameter will cause the "ELSE" part of the shortcode to be suppressed. This can be useful in scenarios where the "ELSE" portion of the shortcode is only applicable to members of the site, for example excluding visitors who are not logged in. Default: no. Required: no. |
Validity
This shortcode is evaluated for any type of visitor.
Conditional Branching
[ELSE_not_allowed_access] conditional branching is supported.
Nesting
Shortcode nesting is NOT supported.
Examples
- Example 1
- Example 2
- Example 3
Will display "Display this content as not allowed access." if the visitor is logged in and does not satisfy the conditions to access the current page/post where the shortcode is used:
[mbr_not_allowed_access]
Display this content as not allowed access.
[/mbr_not_allowed_access]
Will display "Display this content as not allowed access." if the visitor is logged in and does not satisfy the conditions to access the page/post with post_id equal to 1234:
[mbr_not_allowed_access post_id='1234']
Display this content as not allowed access.
[/mbr_not_allowed_access]
Will display "Please signup to be able to access this content." if the visitor does not satisfy the conditions to access the page/post with post_id equal to 1234. Otherwise will display "Display this content as allowed access.":
[mbr_not_allowed_access post_id='1234']
Please signup to be able to access this content.
[ELSE_not_allowed_access]
Display this content as allowed access.
[/mbr_not_allowed_access]
API
There is no ActiveMember360 API function equivalent for this shortcode. Please use standard PHP functions.