GravityView  2.17
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 $is_searchable = true;
16 
17  var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
18 
19  /** @see GF_Field_Website */
20  var $_gf_field_class_name = 'GF_Field_Website';
21 
22  var $group = 'advanced';
23 
24  var $icon = 'dashicons-admin-links';
25 
26  public function __construct() {
27  $this->label = esc_html__( 'Website', 'gk-gravityview' );
28  parent::__construct();
29  }
30 
31  public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
32 
33  // It makes no sense to use this as the link.
34  unset( $field_options['show_as_link'] );
35 
36  if( 'edit' === $context ) {
37  return $field_options;
38  }
39 
40  /**
41  * @since 1.8
42  */
43  $field_options['anchor_text'] = array(
44  'type' => 'text',
45  'label' => __( 'Link Text:', 'gk-gravityview' ),
46  'desc' => __( 'Define custom link text. Leave blank to display the URL', 'gk-gravityview' ),
47  'value' => '',
48  'merge_tags' => 'force',
49  'priority' => 1000,
50  );
51 
52  $field_options['truncatelink'] = array(
53  'type' => 'checkbox',
54  'value' => true,
55  'label' => __( 'Shorten Link Display', 'gk-gravityview' ),
56  'tooltip' => __( 'Only show the domain for a URL instead of the whole link.', 'gk-gravityview' ),
57  'desc' => __( 'Don&rsquo;t show the full URL, only show the domain.', 'gk-gravityview' ),
58  'priority' => 1500,
59  );
60 
61  $this->add_field_support( 'new_window', $field_options );
62 
63  /**
64  * Set default to opening in new links for back-compatibility with Version 1.5.1
65  * @link https://github.com/gravityview/GravityView/commit/e12e76e2d032754227728d41e65103042d4f75ec
66  */
67  $field_options['new_window']['value'] = true;
68  $field_options['new_window']['priority'] = 2000;
69 
70  return $field_options;
71  }
72 
73 }
74 
Modify field settings by extending this class.
field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id)
add_field_support( $key, &$field_options)
Add custom options for date fields.
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