groups
9 months ago
alert.php
2 years ago
animation.php
1 year ago
base-data.php
1 year ago
base-icon-font.php
1 year ago
base-multiple.php
1 year ago
base-ui.php
3 years ago
base-units.php
2 years ago
base.php
3 years ago
box-shadow.php
3 years ago
button.php
3 years ago
choose.php
11 months ago
code.php
3 years ago
color.php
3 years ago
date-time.php
3 years ago
deprecated-notice.php
3 years ago
dimensions.php
1 year ago
divider.php
2 years ago
exit-animation.php
1 year ago
font.php
3 years ago
gallery.php
4 months ago
gaps.php
1 year ago
heading.php
3 years ago
hidden.php
3 years ago
hover-animation.php
1 year ago
icon.php
2 years ago
icons.php
11 months ago
image-dimensions.php
3 years ago
media.php
4 months ago
notice.php
1 year ago
number.php
6 months ago
popover-toggle.php
3 years ago
raw-html.php
3 years ago
repeater.php
11 months ago
section.php
9 months ago
select.php
3 years ago
select2.php
2 years ago
slider.php
3 years ago
structure.php
2 years ago
switcher.php
3 years ago
tab.php
2 years ago
tabs.php
2 years ago
text-shadow.php
3 years ago
text.php
11 months ago
textarea.php
3 years ago
url.php
11 months ago
visual-choice.php
11 months ago
wp-widget.php
3 years ago
wysiwyg.php
3 years ago
text.php
87 lines
| 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 | ?> |
| 45 | <div class="elementor-control-field"> |
| 46 | <# if ( data.label ) {#> |
| 47 | <label for="<?php $this->print_control_uid(); ?>" class="elementor-control-title">{{{ data.label }}}</label> |
| 48 | <# } #> |
| 49 | <div class="elementor-control-input-wrapper elementor-control-unit-5 elementor-control-dynamic-switcher-wrapper"> |
| 50 | <input id="<?php $this->print_control_uid(); ?>" type="{{ data.input_type }}" class="tooltip-target elementor-control-tag-area" data-tooltip="{{ data.title }}" data-setting="{{ data.name }}" placeholder="{{ view.getControlPlaceholder() }}" /> |
| 51 | </div> |
| 52 | </div> |
| 53 | <# if ( data.description ) { #> |
| 54 | <div class="elementor-control-field-description">{{{ data.description }}}</div> |
| 55 | <# } #> |
| 56 | <?php |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Get text control default settings. |
| 61 | * |
| 62 | * Retrieve the default settings of the text control. Used to return the |
| 63 | * default settings while initializing the text control. |
| 64 | * |
| 65 | * @since 1.0.0 |
| 66 | * @access protected |
| 67 | * |
| 68 | * @return array Control default settings. |
| 69 | */ |
| 70 | protected function get_default_settings() { |
| 71 | return [ |
| 72 | 'input_type' => 'text', |
| 73 | 'placeholder' => '', |
| 74 | 'title' => '', |
| 75 | 'ai' => [ |
| 76 | 'active' => true, |
| 77 | 'type' => 'text', |
| 78 | ], |
| 79 | 'dynamic' => [ |
| 80 | 'categories' => [ |
| 81 | TagsModule::TEXT_CATEGORY, |
| 82 | ], |
| 83 | ], |
| 84 | ]; |
| 85 | } |
| 86 | } |
| 87 |