Description
This shortcode reads a value from the $_REQUEST superglobal and displays it on the page. The $_REQUEST array combines values from $_GET, $_POST, and $_COOKIE, making it useful when a value may arrive via any of those channels.
Shortcode Examples
Read a request variable named source (works whether it arrives via GET, POST, or COOKIE):
[memb_request name="source"]
Provide a fallback value when the key is not present:
[memb_request name="source" default="organic"]
Display an ActiveCampaign contact field passed through a form submission:
[memb_request name="firstname"]
Apply text formatting to the output:
[memb_request name="firstname" txtfmt="ucwords"]
Shortcode Parameters
name | (Required) Comma-delimited list of keys to look up in the $_REQUEST variable. |
|---|---|
default | The default value to use if the key is empty. Defaults to an empty string. |
txtfmt | (Optional) Comma-delimited list of text processing functions to apply to the output. |
capture | Captures the shortcode output and routes it to a variable for later use. |
before | Text to display before the output value. |
after | Text to display after the output value. |
htmlattr | If set, outputs the value as an HTML attribute rather than as visible text. |
Additional Information
Using [memb_request] with no parameters displays all $_REQUEST variables for debugging purposes. The presence and order of variables in $_REQUEST is defined by the PHP request_order and variables_order configuration directives. When the same key exists in multiple sources, the value from the source listed later in the order string takes precedence. For example, with request_order = "GPC", COOKIE overrides POST, which overrides GET; reversing it to "CPG" would give GET the highest priority.
Shortcode Attributes
| Conditional | No |
|---|---|
| Nestable | No |
| Accepts formatting | Yes |
| Capturable | Yes |