Skip to main content

mbr_is_conditional

Usage

This shortcode determines the content to be included based upon the evaluation of a conditional.

The purpose, definition, and use of conditionals is explained in detail here:

Conditionals

Parameters

ParametersDescription
fieldThe conditional id to be evaluated.
Default: none.
Required: yes.
Note

To ensure compatibility with the various page builders we recommend that no quote delimiters are used to specify the id parameter.

Quotes are not needed for this shortcode as there can never be any spaces in the id.

Validity

This shortcode is evaluated for any type of visitor.

Beware

Please be aware that if the conditional specified by the id is not published/active this shortcode will not be evaluated and will not display/include any content.

Conditional Branching

[ELSE_is_conditional] conditional branching is supported.

Nesting

Shortcode nesting is supported:

[mbr_is_conditional1] thru [mbr_is_conditional19]
[ELSE_is_conditional1] thru [ELSE_is_conditional19]
[/mbr_is_conditional1] thru [/mbr_is_conditional19]

Examples

Display "Message 1" if the conditional with id 123 evaluates to TRUE:

[mbr_is_conditional id=123]
Message 1
[/mbr_is_conditional]

API

The PHP API function equivalent for this shortcode is:

mbr_is_conditional( id )

where id is an integer and the post_id of the conditional custom post.