PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / trunk
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster vtrunk
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / elementor / modules / optin / fields / time.php

time.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster trunk, at includes/elementor/modules/optin/fields/time.php

85 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || die();
4
5 class Sellkit_Elementor_Optin_Field_Time extends Sellkit_Elementor_Optin_Field_Base {
6
7 public static function get_field_type() {
8 return 'time';
9 }
10
11 public function get_input_type() {
12 return $this->field['native_html5'] ? 'time' : 'text';
13 }
14
15 public function get_class() {
16 return 'sellkit-field flatpickr';
17 }
18
19 public function get_style_depends() {
20 return [ 'flatpickr' ];
21 }
22
23 public function get_script_depends() {
24 return [ 'flatpickr' ];
25 }
26
27 public function add_field_render_attribute() {
28 parent::add_field_render_attribute();
29
30 $this->widget->add_render_attribute( 'field-' . $this->get_id(), [
31 $this->field['native_html5'] ? 'min' : 'data-min-time' => $this->field['min_time'],
32 $this->field['native_html5'] ? 'max' : 'data-max-time' => $this->field['max_time'],
33 'data-enable-time' => 'true',
34 'data-no-calendar' => 'true',
35 'data-time_24hr' => 'true',
36 ] );
37 }
38
39 public function render_content() {
40 ?>
41 <input <?php echo $this->widget->get_render_attribute_string( 'field-' . esc_attr( $this->get_id() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor-generated attributes. ?>>
42 <?php
43 }
44
45 public static function get_additional_controls() {
46 $commons = parent::get_common_controls();
47
48 return [
49 'label' => $commons['label'],
50 'field_value' => $commons['field_value'],
51 'placeholder' => $commons['placeholder'],
52 'min_time' => [
53 'label' => esc_html__( 'Min Time', 'sellkit' ),
54 'type' => 'date_time',
55 'label_block' => false,
56 'conditions' => [ 'terms' => [ parent::get_type_condition() ] ],
57 'picker_options' => [
58 'enableTime' => true,
59 'noCalendar' => true,
60 'time_24hr' => true,
61 ],
62 ],
63 'max_time' => [
64 'label' => esc_html__( 'Max Time', 'sellkit' ),
65 'type' => 'date_time',
66 'label_block' => false,
67 'conditions' => [ 'terms' => [ parent::get_type_condition() ] ],
68 'picker_options' => [
69 'enableTime' => true,
70 'noCalendar' => true,
71 'time_24hr' => true,
72 ],
73 ],
74 'native_html5' => [
75 'label' => esc_html__( 'Native HTML5', 'sellkit' ),
76 'type' => 'switcher',
77 'return_value' => 'true',
78 'conditions' => [ 'terms' => [ parent::get_type_condition() ] ],
79 ],
80 'required' => $commons['required'],
81 'width_responsive' => $commons['width_responsive'],
82 ];
83 }
84 }
85