PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.1
Elementor Website Builder – more than just a page builder v4.2.1
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 4.2.1, at includes/controls/date-time.php

81 lines 2.0 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 use Elementor\Modules\DynamicTags\Module as TagsModule;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 /**
11 * Elementor date/time control.
12 *
13 * A base control for creating date time control. Displays a date/time picker
14 * based on the Flatpickr library @see https://chmln.github.io/flatpickr/ .
15 *
16 * @since 1.0.0
17 */
18 class Control_Date_Time extends Base_Data_Control {
19
20 /**
21 * Get date time control type.
22 *
23 * Retrieve the control type, in this case `date_time`.
24 *
25 * @since 1.0.0
26 * @access public
27 *
28 * @return string Control type.
29 */
30 public function get_type() {
31 return 'date_time';
32 }
33
34 /**
35 * Get date time control default settings.
36 *
37 * Retrieve the default settings of the date time control. Used to return the
38 * default settings while initializing the date time control.
39 *
40 * @since 1.8.0
41 * @access protected
42 *
43 * @return array Control default settings.
44 */
45 protected function get_default_settings() {
46 return [
47 'label_block' => true,
48 'picker_options' => [],
49 'dynamic' => [
50 'categories' => [
51 TagsModule::DATETIME_CATEGORY,
52 ],
53 ],
54 ];
55 }
56
57 /**
58 * Render date time control output in the editor.
59 *
60 * Used to generate the control HTML in the editor using Underscore JS
61 * template. The variables for the class are available using `data` JS
62 * object.
63 *
64 * @since 1.0.0
65 * @access public
66 */
67 public function content_template() {
68 ?>
69 <div class="elementor-control-field">
70 <label for="<?php $this->print_control_uid(); ?>" class="elementor-control-title">{{{ data.label }}}</label>
71 <div class="elementor-control-input-wrapper elementor-control-dynamic-switcher-wrapper">
72 <input id="<?php $this->print_control_uid(); ?>" placeholder="{{ view.getControlPlaceholder() }}" class="elementor-date-time-picker flatpickr elementor-control-tag-area" type="text" data-setting="{{ data.name }}">
73 </div>
74 </div>
75 <# if ( data.description ) { #>
76 <div class="elementor-control-field-description">{{{ data.description }}}</div>
77 <# } #>
78 <?php
79 }
80 }
81