GravityKit\GravityMigrate\Schema\UniversalMergeTag
The values every form plugin lets somebody drop into a subject line or a message.
Three shapes, and the difference matters because each translates differently. A field reference points at a field on this form, so translating it means following the field wherever it landed. A system value is something the platform supplies, like the site's admin address or the visitor's IP, so translating it means knowing what the other platform calls the same thing. A keyed reference names something the site has rather than something the platform has, like a user meta key, so translating it means keeping the key and changing the spelling around it.
The last of those is why a fixed list of values is not enough. {user:department} is a working
Gravity Forms tag on a site with such a field, and no vocabulary could have anticipated it.
Every platform spells both differently. Gravity Forms writes {ip}, Ninja Forms
{other:user_ip}, Forminator {user_ip}, WS Form #submit(user_ip). The value is identical
and only the spelling moves, which is exactly what a vocabulary is for.
Since: %ver%
Source: src/Schema/UniversalMergeTag.php:30
Details
- Kind:
class - Namespace:
GravityKit\GravityMigrate\Schema
Methods
| Method | Description |
|---|---|
field() | A reference to a field on this form. |
system() | A value the platform supplies. |
user_property() | A named property of the signed-in visitor, which may be any meta key the site has. |
post_property() | A named property of the post the form was embedded in. |
post_meta() | A named custom field of that post. |
get_key() | The key this tag names; empty unless it carries one. |
is_keyed() | Whether this carries a key rather than naming a fixed value. |
is_field() | Whether this points at a field on the form. |
is_system() | Whether this is a value the platform supplies. |
get_kind() | Which of the KIND constants this is. |
get_value() | The system value named; empty for a field reference. |
get_field_id() | The field pointed at; empty for a system value. |
get_label() | What that field is called. |
point_at() | Points the reference at a different field. |
Method Reference
field()
public static function field( $field_id, string $label='' ): self
A reference to a field on this form.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field_id | int | string | The field. | |
$label | string | '' | What it is called, where the spelling carries one. |
Returns
self
Since: %ver%
Source: src/Schema/UniversalMergeTag.php:390