GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-source-url.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-source-url.php
4  * @package GravityView
5  * @subpackage includes\fields
6  */
7 
8 /**
9  * Add custom options for source_url fields
10  */
12 
13  var $name = 'source_url';
14 
15  var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
16 
17  var $group = 'meta';
18 
19  public function __construct() {
20  $this->label = esc_html__( 'Source URL', 'gravityview' );
21  parent::__construct();
22  }
23 
24  function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
25 
26  // Don't link to entry; doesn't make sense.
27  unset( $field_options['show_as_link'] );
28 
29  if( 'edit' === $context ) {
30  return $field_options;
31  }
32 
33  $add_options = array();
34  $add_options['link_to_source'] = array(
35  'type' => 'checkbox',
36  'label' => __( 'Link to URL:', 'gravityview' ),
37  'desc' => __('Display as a link to the Source URL', 'gravityview'),
38  'value' => false,
39  'merge_tags' => false,
40  );
41  $add_options['source_link_text'] = array(
42  'type' => 'text',
43  'label' => __( 'Link Text:', 'gravityview' ),
44  'desc' => __('Customize the link text. If empty, the link text will be the the URL.', 'gravityview'),
45  'value' => NULL,
46  'merge_tags' => true,
47  );
48 
49  return $add_options + $field_options;
50  }
51 
52 }
53 
Modify field settings by extending this class.
Add custom options for source_url fields.
$field_id
Definition: time.php:17
field_options($field_options, $template_id, $field_id, $context, $input_type)