GravityKit\EntryTags\EntryTagField
Source: src/EntryTagField.php:19
Details
- Kind:
class - Namespace:
GravityKit\EntryTags - Extends: GF_Field_MultiSelect
Properties
| Property | Type | Description |
|---|---|---|
$type | $type | string |
Methods
| Method | Description |
|---|---|
remember_custom_content_context() | Notes that a Custom Content field is about to replace its merge tags, and remembers its context. |
forget_custom_content_context() | Notes that no Custom Content field is replacing its merge tags any more. |
filter_custom_content() | Turns the escaped tag pills of Entry Tags merge tags back into HTML. |
restore_bracketed_tags() | Shows square brackets in the tags of a text email as they are. |
replace_merge_tags() | Replaces the stored tags with tag pills for merge tags in GravityView Custom Content. |
replace_entry_merge_tags() | Replaces {entry:2} for an Entry Tags field with a comma-separated list of tag values, outside Custom Content. |
Method Reference
remember_custom_content_context()
public static function remember_custom_content_context( $content, $context=null )
Notes that a Custom Content field is about to replace its merge tags, and remembers its context.
Legacy templates pass no context.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$content | |||
$context | null |
Since: 1.5.1
Source: src/EntryTagField.php:160
forget_custom_content_context()
public static function forget_custom_content_context( $output )
Notes that no Custom Content field is replacing its merge tags any more.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$output |
Since: 1.5.1
Source: src/EntryTagField.php:172
filter_custom_content()
public function filter_custom_content( $content )
Turns the escaped tag pills of Entry Tags merge tags back into HTML.
Only markup this plugin rendered is restored; the rest of the content stays escaped.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$content | string | The content to decode. |
Returns
string— The decoded content.
Since: 1.4.1
Source: src/EntryTagField.php:190
restore_bracketed_tags()
public static function restore_bracketed_tags( $email, $message_format )
Shows square brackets in the tags of a text email as they are.
Gravity Forms encodes them so that shortcodes in a value do not run, and it has run the shortcodes by now.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$email | |||
$message_format |
Since: 1.5.1
Source: src/EntryTagField.php:235
replace_merge_tags()
public function replace_merge_tags( $data, $text, $form )
Replaces the stored tags with tag pills for merge tags in GravityView Custom Content.
Anywhere else keeps the stored tags: only Custom Content turns the escaped pills back into HTML, pills would
leak as raw "[url]text" markup once a notification is converted to plain text, and {all_fields} and {Tags:2}
need the saved labels.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$data | array | The data array. | |
$text | string | The text. | |
$form | array | The form array. |
Returns
array— The data array.
Since:
1.41.5.1(Only in GravityView Custom Content.)
Source: src/EntryTagField.php:306
replace_entry_merge_tags()
public function replace_entry_merge_tags( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format )
Replaces {entry:2} for an Entry Tags field with a comma-separated list of tag values, outside Custom Content.
Gravity Forms prints {entry:2} from the same entry {all_fields} reads, so the list goes in the text and the
entry keeps the stored tags.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$text | |||
$form | |||
$entry | |||
$url_encode | |||
$esc_html | |||
$nl2br | |||
$format |
Since: TBD
Source: src/EntryTagField.php:364