PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev2
Elementor Website Builder – more than just a page builder v3.28.0-dev2
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 / visual-choice.php

visual-choice.php in Elementor Website Builder – more than just a page builder 3.28.0-dev2, at includes/controls/visual-choice.php

56 lines 1.8 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 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 /**
9 * Elementor Visual Choice control.
10 *
11 * This control extends the base Choose control allowing the user to choose between options represented by SVG or Image.
12 *
13 * @since 3.28.0
14 */
15 class Control_Visual_Choice extends Base_Data_Control {
16
17 public function get_type() {
18 return 'visual_choice';
19 }
20
21 public function content_template() {
22 $control_uid_input_type = '{{value}}';
23 ?>
24 <div class="elementor-control-field">
25 <label class="elementor-control-title">{{{ data.label }}}</label>
26 <div class="elementor-control-input-wrapper">
27 <div class="elementor-visual-choice-choices" style="--elementor-visual-choice-columns: {{ data.columns }};">
28
29 <# _.each( data.options, function( options, value ) { #>
30 <div class="elementor-visual-choice-element">
31 <input id="<?php $this->print_control_uid( $control_uid_input_type ); ?>" type="radio" name="elementor-visual-choice-{{ data.name }}-{{ data._cid }}" value="{{ value }}">
32 <label class="elementor-visual-choice-label tooltip-target" for="<?php $this->print_control_uid( $control_uid_input_type ); ?>" data-tooltip="{{ options.title }}" title="{{ options.title }}">
33 <img class="elementor-visual-choice-image" src="{{ options.image }}" aria-hidden="true" alt="{{ options.title }}" data-hover="{{ value }}" />
34 <span class="elementor-screen-only">{{{ options.title }}}</span>
35 </label>
36 </div>
37 <# } ); #>
38 </div>
39 </div>
40 </div>
41
42 <# if ( data.description ) { #>
43 <div class="elementor-control-field-description">{{{ data.description }}}</div>
44 <# } #>
45 <?php
46 }
47
48 protected function get_default_settings() {
49 return [
50 'options' => [],
51 'toggle' => true,
52 'columns' => 1,
53 ];
54 }
55 }
56