GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-entry-link.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-entry-link.php
4  * @package GravityView
5  * @subpackage includes\fields
6  */
7 
8 /**
9  * Add custom options for entry_link fields
10  */
12 
13  var $name = 'entry_link';
14 
15  var $contexts = array( 'multiple' );
16 
17  /**
18  * @var bool
19  * @since 1.15.3
20  */
21  var $is_sortable = false;
22 
23  /**
24  * @var bool
25  * @since 1.15.3
26  */
27  var $is_searchable = false;
28 
29  var $group = 'gravityview';
30 
31  public function __construct() {
32  $this->label = esc_html__( 'Link to Entry', 'gravityview' );
33  $this->description = esc_html__('A dedicated link to the single entry with customizable text.', 'gravityview');
34  parent::__construct();
35  }
36 
37  function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
38 
39  // Always a link!
40  unset( $field_options['show_as_link'], $field_options['search_filter'] );
41 
42  if( 'edit' === $context ) {
43  return $field_options;
44  }
45 
46  $add_options = array();
47  $add_options['entry_link_text'] = array(
48  'type' => 'text',
49  'label' => __( 'Link Text:', 'gravityview' ),
50  'desc' => NULL,
51  'value' => __('View Details', 'gravityview'),
52  'merge_tags' => true,
53  );
54 
55  return $add_options + $field_options;
56  }
57 
58 }
59 
Modify field settings by extending this class.
__construct()
Add custom options for entry_link fields.
$is_searchable
$name
new GravityView_Field_Entry_Link
$group
$is_sortable
scale description p description
$field_id
Definition: time.php:17
field_options($field_options, $template_id, $field_id, $context, $input_type)
$contexts