i4w_ifrequest
This shortcode is designed to check for the existence of a $_REQUEST variable 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_ifrequest] conditional branching is supported.
Shortcode nesting is supported: [i4w_ifrequest1] thru [i4w_ifrequest19] and [ELSE_ifrequest1] thru [ELSE_ifrequest19]
Parameters
Section titled “Parameters”| Parameter | Description | Default | Required |
|---|---|---|---|
| request | The name of the $_REQUEST variable for whose existence you are checking. | None | Yes |
| val | A value which the $_REQUEST variable must hold in order to evaluate to true. | None | No |
Example
Section titled “Example”Will display “Test REQUEST is set” if $_REQUEST[‘test_request’] exists:
[i4w_ifrequest request='test_request'] Test REQUEST is set[ELSE_ifrequest] Test REQUEST is NOT set[/i4w_ifrequest]Will display “Test REQUEST is set to 123” if $_REQUEST[‘test_request’] exists AND its value is 123:
[i4w_ifrequest request='test_request' val=123] Test REQUEST is set to 123[ELSE_ifrequest] Test REQUEST is NOT set to 123[/i4w_ifrequest]