Skip to main content

mbr_is_for

Usage

This shortcode determines the content to be included based upon a comparison of ActiveCampaign tags and/or contact ID that the visitor has to the conditions defined in the shortcode parameters.

An alternative to using a series of [mbr_is_for] shortcodes for ActiveCampaign tag conditions is to use the [mbr_casetag] shortcode, which can make your code both shorter and easier to manage.

Parameters

ParametersDescription
tagsOne or more tag ID's or tag names defined within ActiveCampaign and used to evaluate the condition. This condition evaluates as true if the remote user has any of the tags specified. The available tags can be found in ActiveMember360, Utilities, Tags. If more than one is entered, please separate with commas.
Default: none.
Required: yes if parameters exclude_tags, only_cid or exclude_cid are not specified.
require_all_tagsSpecifies whether ALL tags specified using the tag parameter must be present in order to satisfy the condition.
Permitted Values: yes, no
Default: no
Required: no.
exclude_tagsOne or more tag IDs or tag names defined within ActiveCampaign and used to evaluate the condition. This condition evaluates as true if the remote user has none of the tags specified. The available tags can be found in ActiveMember360, Utilities, Tags. If more than one is entered, please separate with commas.
Default: none.
Required: yes if parameters tags, only_cid or exclude_cid are not specified.
only_cidOne or more contact IDs that exist within ActiveCampaign and used to evaluate the condition. This condition evaluates as true if the remote user has a contact ID matching any of those specified. If more than one is entered, please separate with commas.
Default: none.
Required: yes if parameters tags, exclude_tags or exclude_cid are not specified.
exclude_cidOne or more contact IDs that exist within ActiveCampaign and used to evaluate the condition. This condition evaluates as true if the remote user does not have a contact ID matching any of those specified. If more than one is entered, please separate with commas.
Default: none.
Required: yes if parameters tags, exclude_tags or only_cid are not specified.
limit_elseIf 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][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.
Permitted Values: yes, no
Default: no
Required: no.
Tag ID's vs. tag names

The use of tag ID's over tag names is encouraged. Unless a tag is deleted, its tag ID can be considered persistent and unique. Tag names, on the other hand, can be changed at any time and do not need to be unique. Using a tag name that is not unique or has been changed can cause your shortcode, hook or module to no longer work as expected.

Validity

This shortcode is evaluated for any type of visitor.

For a local WordPress user with the Administrator role the shortcode will always evaluate as TRUE.

For public visitors or other local WordPress users the shortcode will always evaluate as FALSE and show the [ELSE_is_for] content unless the limit_else parameter is specified in which case nothing will be returned.

Conditional Branching

[ELSE_is_for] conditional branching is supported.

Nesting

Shortcode nesting is supported: [mbr_is_for1] thru [mbr_is_for19]
[ELSE_is_for1] thru [ELSE_is_for19]
[/mbr_is_for1] thru [/mbr_is_for19]

Examples

The content returned will be 'You have at least one of the tags' if the current remote user has ANY of the ActiveCampaign tags 123,456 or MY TAG NAME:

[mbr_is_for tags='123,456,MY TAG NAME']
You have at least one of the tags
[/mbr_is_for]

API

For ActiveCampaign tag conditions ActiveMember360 provides the PHP conditional function:

(mbr_has_tags( $tags, $mode ))

Parameters

ParametersTypeDescription
$tags(string|array)One or more tag ID's or tag names defined within ActiveCampaign and used to evaluate the condition.
Default: none.
Required: no.
$mode(string)Specifies whether the current remote user must have ANY or ALL tags specified using the $tags in order to satisfy the condition.
Permitted Values: any, all, any
Default: any
Required: no.

Return

(bool) True if the current remote user satisfies the condition. False otherwise.

API Examples:

Statement evaluates as TRUE if the user HAS tag 123.

mbr_has_tags( '123' )