i4w_select

Usage:

This shortcode returns a value from a list, based on a switch variable, similar to a “switch…case…” programming construct.

This shortcode does NOT supports conditional branching with [ELSE_select].

Shortcode nesting is NOT supported.

Parameters:

case A list of values, separated by ‘|’ (pipe). The first item in the list is the switch value to be compared against the remaining values.
Default: none.
Required: yes.

Example:

[i4w_select case='2|yes|no|maybe'] (returns 'no')

[i4w_select case='maybe|yes|no|maybe'] (return '3')

Notes:

If a number (integer) is used as the switch variable, the n-th ordinal value will be returned, if there is one.

If a string (alhpanumeric) is used as the switch variable, the ordinal number of the matching value is returned (if the third item matches, a 3 is returned).

API:

There is no API function equivalent for this shortcode.