i4w_ifcookie

Usage:

This shortcode is designed to check for the existence of a cookie and, given a value to check, for a value match. Any content embedded between the tags will be displayed if the criteria is met.

[ELSE_ifcookie] conditional branching is supported.

Shortcode nesting is supported:[i4w_ifcookie1] thru [i4w_ifcookie19]

[ELSE_ifcookie1] thru [ELSE_ifcookie19]

Parameters:

cookie The name of the cookie for whose existence you are checking.
Default: none.
Required: yes.
val A value which the cookie must hold in order for the shortcode to evaluate to true.
Default: none.
Required: no.

Example:

Will display “Test Cookie is set” if a cookie by the name of “test_cookie” exists, without checking the value:

[i4w_ifcookie cookie='test_cookie']
  Test Cookie is set
[ELSE_ifcookie]
  Test Cookie is NOT set
[/i4w_ifcookie]

Will display “Test Cookie is set” if a cookie by the name of “test_cookie” exists AND its value is 123.

[i4w_ifcookie cookie='test_cookie' val=123]
  Test Cookie is set to 123
[ELSE_ifcookie]
  Test Cookie is NOT set to 123
[/i4w_ifcookie]

API:

There is no API function equivalent for this shortcode.