GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-website.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-website.php
4  * @package GravityView
5  * @subpackage includes\fields
6  */
7 
8 /**
9  * Add custom options for date fields
10  */
12 
13  var $name = 'website';
14 
15  var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
16 
17  var $_gf_field_class_name = 'GF_Field_Website';
18 
19  var $group = 'advanced';
20 
21  public function __construct() {
22  $this->label = esc_html__( 'Website', 'gravityview' );
23  parent::__construct();
24  }
25 
26  function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) {
27 
28  // It makes no sense to use this as the link.
29  unset( $field_options['show_as_link'] );
30 
31  if( 'edit' === $context ) {
32  return $field_options;
33  }
34 
35  /**
36  * @since 1.8
37  */
38  $field_options['anchor_text'] = array(
39  'type' => 'text',
40  'label' => __( 'Link Text:', 'gravityview' ),
41  'desc' => __( 'Define custom link text. Leave blank to display the URL', 'gravityview' ),
42  'value' => '',
43  'merge_tags' => 'force',
44  );
45 
46  $field_options['truncatelink'] = array(
47  'type' => 'checkbox',
48  'value' => true,
49  'label' => __( 'Shorten Link Display', 'gravityview' ),
50  'tooltip' => __( 'Only show the domain for a URL instead of the whole link.', 'gravityview' ),
51  'desc' => __( 'Don&rsquo;t show the full URL, only show the domain.', 'gravityview' )
52  );
53 
54  $field_options['open_same_window'] = array(
55  'type' => 'checkbox',
56  'value' => false,
57  'label' => __( 'Open link in the same window?', 'gravityview' ),
58  );
59 
60  return $field_options;
61  }
62 
63 }
64 
field_options($field_options, $template_id= '', $field_id= '', $context= '', $input_type= '')
Modify field settings by extending this class.
Add custom options for date fields.
$field_id
Definition: time.php:17