Skip to main content

i4w_ifget

Usage

This shortcode is designed to check for the existence of a $_GET 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_ifget] conditional branching is supported.

Shortcode nesting is supported: [i4w_ifget1] thru [i4w_ifget19] and [ELSE_ifget1] thru [ELSE_ifget19]

Parameters

ParameterDescriptionDefaultRequired
getThe name of the $_GET variable for whose existence you are checking.NoneYes
valA value which the $_GET variable must hold in order for the shortcode to evaluate to true.NoneNo

Example

Will display "Test GET is set" if $_GET['test_get'] exists:

Shortcode
[i4w_ifget get='test_get']
Test GET is set
[ELSE_ifget]
Test GET is NOT set
[/i4w_ifget]

Will display "Test GET is set" if $_GET['test_get'] exists AND its value is 123:

Shortcode
[i4w_ifget get='test_get' val=123]
Test GET is set
[ELSE_ifget]
Test GET is NOT set
[/i4w_ifget]