GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-textarea.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-textarea.php
4  * @package GravityView
5  * @subpackage includes\fields
6  */
7 
8 /**
9  * Add custom options for textarea fields
10  */
12 
13  var $name = 'textarea';
14 
15  var $is_searchable = true;
16 
17  var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
18 
19  var $_gf_field_class_name = 'GF_Field_Textarea';
20 
21  var $group = 'standard';
22 
23  var $icon = 'dashicons-editor-paragraph';
24 
25  public function __construct() {
26  $this->label = esc_html__( 'Paragraph Text', 'gk-gravityview' );
27  parent::__construct();
28  }
29 
30  public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
31 
32  if( 'edit' === $context ) {
33  return $field_options;
34  }
35 
36  unset( $field_options['show_as_link'] );
37 
38  $field_options['trim_words'] = array(
39  'type' => 'number',
40  'merge_tags' => false,
41  'value' => null,
42  'label' => __( 'Maximum words shown', 'gk-gravityview' ),
43  'tooltip' => __( 'Enter the number of words to be shown. If specified it truncates the text. Leave it blank if you want to show the full text.', 'gk-gravityview' ),
44  );
45 
46  $field_options['make_clickable'] = array(
47  'type' => 'checkbox',
48  'merge_tags' => false,
49  'value' => 0,
50  'label' => __( 'Convert text URLs to HTML links', 'gk-gravityview' ),
51  'tooltip' => __( 'Converts URI, www, FTP, and email addresses in HTML links', 'gk-gravityview' ),
52  );
53 
54  $field_options['allow_html'] = array(
55  'type' => 'checkbox',
56  'merge_tags' => false,
57  'value' => 1,
58  'label' => __( 'Display as HTML', 'gk-gravityview' ),
59  'tooltip' => esc_html__( 'If enabled, safe HTML will be displayed and unsafe or unrecognized HTML tags will be stripped. If disabled, the field value will be displayed as text.', 'gk-gravityview' ),
60  );
61 
62  return $field_options;
63  }
64 
65 }
66 
Modify field settings by extending this class.
field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
if(empty( $created_by)) $form_id
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
Definition: time.php:22
Add custom options for textarea fields.