Description
This shortcode reads a value from the $_POST superglobal and displays it on the page. It is commonly used to display submitted form field values after a POST request.
Shortcode Examples
Display a submitted form field named first_name:
[memb_post name="first_name"]
Display a submitted value with a default if not present:
[memb_post name="first_name" default="Guest"]
Apply text formatting to the output:
[memb_post name="first_name" txtfmt="strtoupper"]
Shortcode Parameters
name | (Required) Comma-delimited list of keys to look up in the $_POST 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_post] with no parameters displays all $_POST variables for debugging purposes. This shortcode only works when the page receives a POST request, such as after a form submission.
Shortcode Attributes
| Conditional | No |
|---|---|
| Nestable | No |
| Accepts formatting | Yes |
| Capturable | Yes |