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 / text.php

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

84 lines 2.1 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 text control.
12 *
13 * A base control for creating text control. Displays a simple text input.
14 *
15 * @since 1.0.0
16 */
17 class Control_Text extends Base_Data_Control {
18
19 /**
20 * Get text control type.
21 *
22 * Retrieve the control type, in this case `text`.
23 *
24 * @since 1.0.0
25 * @access public
26 *
27 * @return string Control type.
28 */
29 public function get_type() {
30 return 'text';
31 }
32
33 /**
34 * Render text control output in the editor.
35 *
36 * Used to generate the control HTML in the editor using Underscore JS
37 * template. The variables for the class are available using `data` JS
38 * object.
39 *
40 * @since 1.0.0
41 * @access public
42 */
43 public function content_template() {
44 $control_uid = $this->get_control_uid();
45 ?>
46 <div class="elementor-control-field">
47 <# if ( data.label ) {#>
48 <label for="<?php echo $control_uid; ?>" class="elementor-control-title">{{{ data.label }}}</label>
49 <# } #>
50 <div class="elementor-control-input-wrapper elementor-control-unit-5 elementor-control-dynamic-switcher-wrapper">
51 <input id="<?php echo $control_uid; ?>" type="{{ data.input_type }}" class="tooltip-target elementor-control-tag-area" data-tooltip="{{ data.title }}" title="{{ data.title }}" data-setting="{{ data.name }}" placeholder="{{ data.placeholder }}" />
52 </div>
53 </div>
54 <# if ( data.description ) { #>
55 <div class="elementor-control-field-description">{{{ data.description }}}</div>
56 <# } #>
57 <?php
58 }
59
60 /**
61 * Get text control default settings.
62 *
63 * Retrieve the default settings of the text control. Used to return the
64 * default settings while initializing the text control.
65 *
66 * @since 1.0.0
67 * @access protected
68 *
69 * @return array Control default settings.
70 */
71 protected function get_default_settings() {
72 return [
73 'input_type' => 'text',
74 'placeholder' => '',
75 'title' => '',
76 'dynamic' => [
77 'categories' => [
78 TagsModule::TEXT_CATEGORY,
79 ],
80 ],
81 ];
82 }
83 }
84