PluginProbe
Elementor Website Builder – more than just a page builder / 3.2.5
Elementor Website Builder – more than just a page builder v3.2.5
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / controls / date-time.php

date-time.php in Elementor Website Builder – more than just a page builder 3.2.5, at includes/controls/date-time.php

75 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 /**
9 * Elementor date/time control.
10 *
11 * A base control for creating date time control. Displays a date/time picker
12 * based on the Flatpickr library @see https://chmln.github.io/flatpickr/ .
13 *
14 * @since 1.0.0
15 */
16 class Control_Date_Time extends Base_Data_Control {
17
18 /**
19 * Get date time control type.
20 *
21 * Retrieve the control type, in this case `date_time`.
22 *
23 * @since 1.0.0
24 * @access public
25 *
26 * @return string Control type.
27 */
28 public function get_type() {
29 return 'date_time';
30 }
31
32 /**
33 * Get date time control default settings.
34 *
35 * Retrieve the default settings of the date time control. Used to return the
36 * default settings while initializing the date time control.
37 *
38 * @since 1.8.0
39 * @access protected
40 *
41 * @return array Control default settings.
42 */
43 protected function get_default_settings() {
44 return [
45 'label_block' => true,
46 'picker_options' => [],
47 ];
48 }
49
50 /**
51 * Render date time control output in the editor.
52 *
53 * Used to generate the control HTML in the editor using Underscore JS
54 * template. The variables for the class are available using `data` JS
55 * object.
56 *
57 * @since 1.0.0
58 * @access public
59 */
60 public function content_template() {
61 $control_uid = $this->get_control_uid();
62 ?>
63 <div class="elementor-control-field">
64 <label for="<?php echo $control_uid; ?>" class="elementor-control-title">{{{ data.label }}}</label>
65 <div class="elementor-control-input-wrapper">
66 <input id="<?php echo $control_uid; ?>" placeholder="{{ data.placeholder }}" class="elementor-date-time-picker flatpickr" type="text" data-setting="{{ data.name }}">
67 </div>
68 </div>
69 <# if ( data.description ) { #>
70 <div class="elementor-control-field-description">{{{ data.description }}}</div>
71 <# } #>
72 <?php
73 }
74 }
75