Skip to main content

GF_Field_Textarea

Source: includes/fields/class-gf-field-textarea.php:8

Details

  • Kind: class
  • Namespace: (global)
  • Extends: GF_Field

Methods

MethodDescription
get_form_editor_field_description()Returns the field's form editor description.
get_form_editor_field_icon()Returns the field's form editor icon.
rte_plain_text_value()Get TinyMCE "plain text" value for submitted HTML.
remove_textarea_texturize()Adds 'textarea' to the list of tags that should not be texturized.
get_value_entry_detail()Format the entry value for display on the entry detail page and for the {all_fields} merge tag.
get_value_merge_tag()Format the entry value for when the field/input merge tag is processed. Not called for the {all_fields} merge tag.
is_rich_edit_enabled()Determines if the RTE can be enabled for the current field and user.
filter_user_option_rich_editing()Filter the rich_editing option for the current user.
get_filter_operators()Returns the filter operators for the current field.

Method Reference

get_form_editor_field_description()

public function get_form_editor_field_description()

Returns the field's form editor description.

Returns

  • string

Since: 2.5

Source: includes/fields/class-gf-field-textarea.php:23

get_form_editor_field_icon()

public function get_form_editor_field_icon()

Returns the field's form editor icon.

This could be an icon url or a gform-icon class.

Returns

  • string

Since: 2.5

Source: includes/fields/class-gf-field-textarea.php:36

rte_plain_text_value()

public function rte_plain_text_value( $html )

Get TinyMCE "plain text" value for submitted HTML.

Mirrors JS code: editor.getContent({ format: 'text' }).trim().length

Parameters

NameTypeDefaultDescription
$htmlstringThe HTML content from the RTE.

Returns

  • string — The plain text value of the specified $html string.

Since: 3.0.0

Source: includes/fields/class-gf-field-textarea.php:241

remove_textarea_texturize()

public static function remove_textarea_texturize( $tags )

Adds 'textarea' to the list of tags that should not be texturized.

Parameters

NameTypeDefaultDescription
$tagsarrayThe list of tags that should not be texturized.

Returns

  • array — The updated list of tags.

Since: 2.9.1

Source: includes/fields/class-gf-field-textarea.php:269

get_value_entry_detail()

public function get_value_entry_detail( $value, $entry=[], $use_text=false, $format='html', $media='screen' )

Format the entry value for display on the entry detail page and for the {all_fields} merge tag.

Return a value that's safe to display for the context of the given $format.

Parameters

NameTypeDefaultDescription
$valuestring | arrayThe field value.
$entryarray[]The entry.
$use_textbool | falsefalseWhen processing choice based fields should the choice text be returned instead of the value.
$formatstring'html'The format requested for the location the merge is being used. Possible values: html, text or url.
$mediastring'screen'The location where the value will be displayed. Possible values: screen or email.

Returns

  • string

Since:

  • 1.9
  • 2.9.29 (Changed the second parameter $currency (string) to $entry (array).)

Source: includes/fields/class-gf-field-textarea.php:369

get_value_merge_tag()

public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br )

Format the entry value for when the field/input merge tag is processed. Not called for the {all_fields} merge tag.

Return a value that is safe for the context specified by $format.

Parameters

NameTypeDefaultDescription
$valuestring | arrayThe field value. Depending on the location the merge tag is being used the following functions may have already been applied to the value: esc_html, nl2br, and urlencode.
$input_idstringThe field or input ID from the merge tag currently being processed.
$entryarrayThe Entry Object currently being processed.
$formarrayThe Form Object currently being processed.
$modifierstringThe merge tag modifier. e.g. value
$raw_valuestring | arrayThe raw field value from before any formatting was applied to $value.
$url_encodeboolIndicates if the urlencode function may have been applied to the $value.
$esc_htmlboolIndicates if the esc_html function may have been applied to the $value.
$formatstringThe format requested for the location the merge is being used. Possible values: html, text or url.
$nl2brboolIndicates if the nl2br function may have been applied to the $value.

Returns

  • string

Since: Unknown

Source: includes/fields/class-gf-field-textarea.php:412

is_rich_edit_enabled()

public function is_rich_edit_enabled()

Determines if the RTE can be enabled for the current field and user.

Returns

  • bool

Since: 2.2.5.14

Source: includes/fields/class-gf-field-textarea.php:441

filter_user_option_rich_editing()

public function filter_user_option_rich_editing( $value )

Filter the rich_editing option for the current user.

Parameters

NameTypeDefaultDescription
$valuestringThe value of the rich_editing option for the current user.

Returns

  • string

Since: 2.2.5.14

Source: includes/fields/class-gf-field-textarea.php:465

get_filter_operators()

public function get_filter_operators()

Returns the filter operators for the current field.

Returns

  • array

Since: 2.4

Source: includes/fields/class-gf-field-textarea.php:478