GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-field-payment-date.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file class-gravityview-field-payment-date.php
4  * @package GravityView
5  * @subpackage includes\fields
6  * @since 1.16
7  */
8 
10 
11  var $name = 'payment_date';
12 
13  var $is_searchable = true;
14 
15  var $search_operators = array( 'less_than', 'greater_than', 'is', 'isnot' );
16 
17  var $group = 'pricing';
18 
19  var $_custom_merge_tag = 'payment_date';
20 
21  var $icon = 'dashicons-cart';
22 
23  /**
24  * GravityView_Field_Date_Created constructor.
25  */
26  public function __construct() {
27 
28  // Constructor before the variables because the class extends Date_Created
29  parent::__construct();
30 
31  $this->label = esc_html__( 'Payment Date', 'gk-gravityview' );
32  $this->description = esc_html__( 'The date the payment was received.', 'gk-gravityview' );
33 
34  add_filter( 'gravityview/field/payment_date/value', array( $this, 'get_value' ), 10, 6 );
35  }
36 
37  /**
38  * Filter the value of the field, future.
39  *
40  * @since 2.0
41  *
42  * @param mixed $value The value of the field.
43  * @param \GV\Field $field The field as seen by future.
44  * @param \GV\View $view The view requested in.
45  * @param \GV\Source $source The data source (form).
46  * @param \GV\Entry $entry The entry.
47  * @param \GV\Request $request The request context.
48  *
49  * @return mixed $value The filtered value.
50  */
51  public function get_value( $value, $field, $view, $source, $entry, $request ) {
52  /** Supply the raw value instead whatever may have been filtered before. */
53  $raw_value = empty( $entry[ $this->name ] ) ? null : $entry[ $this->name ];
54  return $this->get_content( $value, $entry->as_entry(), $field->as_configuration(), array( 'value' => $raw_value ) );
55  }
56 }
57 
get_content( $output='', $entry=array(), $field_settings=array(), $field=array())
Filter the value of the field.
__construct()
GravityView_Field_Date_Created constructor.
get_value( $value, $field, $view, $source, $entry, $request)
Filter the value of the field, future.
scale description p description
$entry
Definition: notes.php:27