mbr_is_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_is_allowed_access] conditional branching is supported.
Nesting
Shortcode nesting is NOT supported.
Examples
- Example 1
- Example 2
- Example 3
- Example 4
Will display "Display this content as allowed access." if the visitor is logged in and satisfy the conditions to access the current page/post where the shortcode is used:
[mbr_is_allowed_access]
Display this content as allowed access.
[/mbr_is_allowed_access]
Will display "Display this content as allowed access." if the visitor is logged in and satisfy the conditions to access the page/post with post_id equal to 1234:
[mbr_is_allowed_access post_id='1234']
Display this content as allowed access.
[/mbr_is_allowed_access]
Will display "Display this content as allowed access." if the visitor is logged in and satisfy the conditions to access the page/post with post_id equal to 1234. Otherwise will display "Please signup to be able to access this content.":
[mbr_is_allowed_access post_id='1234']
Display this content as allowed access.
[ELSE_is_allowed_access]
Please signup to be able to access this content.
[/mbr_is_allowed_access]
Will display "Display this content as allowed access." if the visitor is logged in and satisfy the conditions to access the page/post with post_id equal to 1234. Otherwise will display "Please upgrade your membership to be able to access this content." but only if the visitor is logged in and a member of the site:
[mbr_is_allowed_access post_id='1234' limit_else='yes']
Display this content as allowed access.
[ELSE_is_allowed_access]
Please upgrade your membership to be able to access this content.
[/mbr_is_allowed_access]
API
There is no ActiveMember360 API function equivalent for this shortcode. Please use standard PHP functions.