GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-phone.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-phone.php
4  * @package GravityView
5  * @subpackage includes\fields
6  */
7 
9 
10  var $name = 'phone';
11 
12  var $is_searchable = true;
13 
14  var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
15 
16  /** @see GF_Field_Phone */
17  var $_gf_field_class_name = 'GF_Field_Phone';
18 
19  var $group = 'advanced';
20 
21  var $icon = 'dashicons-smartphone';
22 
23  public function __construct() {
24  $this->label = esc_html__( 'Phone', 'gk-gravityview' );
25  parent::__construct();
26  }
27 
28  /**
29  * Add option to link phone number
30  *
31  * @since 1.17
32  *
33  * @param array $field_options
34  * @param string $template_id
35  * @param string $field_id
36  * @param string $context
37  * @param string $input_type
38  *
39  * @return array
40  */
41  public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
42 
43  if( 'edit' === $context ) {
44  return $field_options;
45  }
46 
47  $field_options['link_phone'] = array(
48  'type' => 'checkbox',
49  'label' => __( 'Make Phone Number Clickable', 'gk-gravityview' ),
50  'desc' => __( 'Allow dialing a number by clicking it?', 'gk-gravityview'),
51  'value' => true,
52  'group' => 'display',
53  'priority' => 100,
54  );
55 
56  return $field_options;
57  }
58 }
59 
Modify field settings by extending this class.
if(empty( $created_by)) $form_id
field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
Add option to link phone number.
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
Definition: time.php:22