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

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

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