PluginProbe
Elementor Website Builder – more than just a page builder / 3.27.5
Elementor Website Builder – more than just a page builder v3.27.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.27.5, at includes/controls/textarea.php

83 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 'ai' => [
50 'active' => true,
51 'type' => 'textarea',
52 ],
53 'dynamic' => [
54 'categories' => [ TagsModule::TEXT_CATEGORY ],
55 ],
56 ];
57 }
58
59 /**
60 * Render textarea control output in the editor.
61 *
62 * Used to generate the control HTML in the editor using Underscore JS
63 * template. The variables for the class are available using `data` JS
64 * object.
65 *
66 * @since 1.0.0
67 * @access public
68 */
69 public function content_template() {
70 ?>
71 <div class="elementor-control-field">
72 <label for="<?php $this->print_control_uid(); ?>" class="elementor-control-title">{{{ data.label }}}</label>
73 <div class="elementor-control-input-wrapper elementor-control-dynamic-switcher-wrapper">
74 <textarea id="<?php $this->print_control_uid(); ?>" class="elementor-control-tag-area" rows="{{ data.rows }}" data-setting="{{ data.name }}" placeholder="{{ view.getControlPlaceholder() }}"></textarea>
75 </div>
76 </div>
77 <# if ( data.description ) { #>
78 <div class="elementor-control-field-description">{{{ data.description }}}</div>
79 <# } #>
80 <?php
81 }
82 }
83