Merge tag {get:PARAM}
URL query parameter. A value from the page URL. Several values are joined with ", ". Escaped with esc_html() by default. To pass the value on in a link, add :urlencode or :rawurlencode (GravityView 3.9 or later), as in ?gv_search={get:gv_search:urlencode}.
On the test entry, {get:search} gives rocket science.
| Product | GravityView |
|---|---|
| Requires | GravityView 1.15 or later |
| Needs an entry | No |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| Query parameter name | text | Yes | — | The parameter's name, not its value: on a page ending ?search=widgets, {get:search} shows widgets. In a link, add :urlencode after the name so "&", "#" and "+" reach the next page as typed: on a page ending ?gv_search=R%26D, <a href="?gv_search={get:gv_search:urlencode}"> links to ?gv_search=R%26D, where {get:gv_search} would cut the search off at "&". :rawurlencode does the same but writes a space as %20 instead of +, which mailto: links need. Both need GravityView 3.9 or later. |
Examples
Output from the real plugin code, run on a test entry.
| Merge tag | Output |
|---|---|
{get:search} | rocket science |