The {gv_magic_link} Merge Tag
The GravityView Magic Links plugin provides a merge tag that allows you to generate magic links for entry editing.
Basic Usage #
The basic merge tag syntax requires a View ID:{gv_magic_link view_id=123}
This will output a link with the default text “Edit Entry”.
Parameters #
The merge tag supports the following parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
view_id | integer | Yes | None | The ID of the View to generate the magic link for. |
post_id | integer | No | View ID | The ID of the post/page where the View is embedded. If not provided, uses the View ID. |
text | string | No | “Edit Entry” | The text to display for the link. |
format | string | No | “link” | The output format. Use “url” to get just the URL without link formatting. |
action | string | No | “edit” | The action the magic link performs. Use “delete” for deletion links. |
Examples #
Basic Link (Required View ID)
{gv_magic_link view_id=123} Output: <a href="...">Edit Entry</a>
Custom Link Text
{gv_magic_link view_id=123 text="Click here"}
Output: <a href="...">Click here</a>
Specific View and Post
{gv_magic_link view_id=123 post_id=456} Output: <a href="...">Edit Entry</a>
URL Format (No Link)
{gv_magic_link view_id=123 format="url"} Output: https://example.com/...
URL Format with Post ID
{gv_magic_link view_id=123 post_id=456 format="url"} Output: https://example.com/...
Link Format with Custom Text
{gv_magic_link view_id=123 format="link" text="Click here"} Output: <a href="...">Click here</a>
Deletion Link
{gv_magic_link view_id="123" action="delete"} Output: <a href="...">Delete Entry</a>
Deletion Link with Custom Text
{gv_magic_link view_id="123" action="delete" text="Click to Delete"} Output: <a href="...">Click to Delete</a>
Usage in Gravity Forms #
You can use this merge tag in any Gravity Forms field that supports merge tags, such as:
- HTML fields
- Text fields
- Email notifications
- Confirmation messages
Notes #
- The
view_idparameter is required. If not provided, the merge tag will output an empty string. - The merge tag outputs nothing when the entry has no valid email address in the View’s Email Field, or in the form’s first Email field when the View is set to Don’t validate by email field.
- The link expires after the View’s Link Expiration. While it hasn’t expired, the merge tag reuses it, so sending a notification again doesn’t cancel an earlier link. To stop one, see Stopping a link that was already sent.