Skip to main content

GravityKit\EntryTags\EntryTagField

Source: src/EntryTagField.php:19

Details​

Properties​

PropertyTypeDescription
$type$typestring

Methods​

MethodDescription
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​

NameTypeDefaultDescription
$content
$contextnull

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​

NameTypeDefaultDescription
$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​

NameTypeDefaultDescription
$contentstringThe 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​

NameTypeDefaultDescription
$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​

NameTypeDefaultDescription
$dataarrayThe data array.
$textstringThe text.
$formarrayThe form array.

Returns​

  • array — The data array.

Since:

  • 1.4
  • 1.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​

NameTypeDefaultDescription
$text
$form
$entry
$url_encode
$esc_html
$nl2br
$format

Since: TBD

Source: src/EntryTagField.php:364