PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.3
Elementor Website Builder – more than just a page builder v3.16.3
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 / widgets / icon-box.php

icon-box.php in Elementor Website Builder – more than just a page builder 3.16.3, at includes/widgets/icon-box.php

782 lines 19.9 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 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
9 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
10
11 /**
12 * Elementor icon box widget.
13 *
14 * Elementor widget that displays an icon, a headline and a text.
15 *
16 * @since 1.0.0
17 */
18 class Widget_Icon_Box extends Widget_Base {
19
20 /**
21 * Get widget name.
22 *
23 * Retrieve icon box widget name.
24 *
25 * @since 1.0.0
26 * @access public
27 *
28 * @return string Widget name.
29 */
30 public function get_name() {
31 return 'icon-box';
32 }
33
34 /**
35 * Get widget title.
36 *
37 * Retrieve icon box widget title.
38 *
39 * @since 1.0.0
40 * @access public
41 *
42 * @return string Widget title.
43 */
44 public function get_title() {
45 return esc_html__( 'Icon Box', 'elementor' );
46 }
47
48 /**
49 * Get widget icon.
50 *
51 * Retrieve icon box widget icon.
52 *
53 * @since 1.0.0
54 * @access public
55 *
56 * @return string Widget icon.
57 */
58 public function get_icon() {
59 return 'eicon-icon-box';
60 }
61
62 /**
63 * Get widget keywords.
64 *
65 * Retrieve the list of keywords the widget belongs to.
66 *
67 * @since 2.1.0
68 * @access public
69 *
70 * @return array Widget keywords.
71 */
72 public function get_keywords() {
73 return [ 'icon box', 'icon' ];
74 }
75
76 /**
77 * Register icon box widget controls.
78 *
79 * Adds different input fields to allow the user to change and customize the widget settings.
80 *
81 * @since 3.1.0
82 * @access protected
83 */
84 protected function register_controls() {
85 $this->start_controls_section(
86 'section_icon',
87 [
88 'label' => esc_html__( 'Icon Box', 'elementor' ),
89 ]
90 );
91
92 $this->add_control(
93 'selected_icon',
94 [
95 'label' => esc_html__( 'Icon', 'elementor' ),
96 'type' => Controls_Manager::ICONS,
97 'fa4compatibility' => 'icon',
98 'default' => [
99 'value' => 'fas fa-star',
100 'library' => 'fa-solid',
101 ],
102 ]
103 );
104
105 $this->add_control(
106 'view',
107 [
108 'label' => esc_html__( 'View', 'elementor' ),
109 'type' => Controls_Manager::SELECT,
110 'options' => [
111 'default' => esc_html__( 'Default', 'elementor' ),
112 'stacked' => esc_html__( 'Stacked', 'elementor' ),
113 'framed' => esc_html__( 'Framed', 'elementor' ),
114 ],
115 'default' => 'default',
116 'prefix_class' => 'elementor-view-',
117 'condition' => [
118 'selected_icon[value]!' => '',
119 ],
120 ]
121 );
122
123 $this->add_control(
124 'shape',
125 [
126 'label' => esc_html__( 'Shape', 'elementor' ),
127 'type' => Controls_Manager::SELECT,
128 'options' => [
129 'circle' => esc_html__( 'Circle', 'elementor' ),
130 'square' => esc_html__( 'Square', 'elementor' ),
131 ],
132 'default' => 'circle',
133 'condition' => [
134 'view!' => 'default',
135 'selected_icon[value]!' => '',
136 ],
137 'prefix_class' => 'elementor-shape-',
138 ]
139 );
140
141 $this->add_control(
142 'title_text',
143 [
144 'label' => esc_html__( 'Title', 'elementor' ),
145 'type' => Controls_Manager::TEXT,
146 'dynamic' => [
147 'active' => true,
148 ],
149 'default' => esc_html__( 'This is the heading', 'elementor' ),
150 'placeholder' => esc_html__( 'Enter your title', 'elementor' ),
151 'label_block' => true,
152 ]
153 );
154
155 $this->add_control(
156 'description_text',
157 [
158 'label' => esc_html__( 'Description', 'elementor' ),
159 'type' => Controls_Manager::TEXTAREA,
160 'dynamic' => [
161 'active' => true,
162 ],
163 'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ),
164 'placeholder' => esc_html__( 'Enter your description', 'elementor' ),
165 'rows' => 10,
166 ]
167 );
168
169 $this->add_control(
170 'link',
171 [
172 'label' => esc_html__( 'Link', 'elementor' ),
173 'type' => Controls_Manager::URL,
174 'dynamic' => [
175 'active' => true,
176 ],
177 'separator' => 'before',
178 ]
179 );
180
181 $this->add_control(
182 'title_size',
183 [
184 'label' => esc_html__( 'Title HTML Tag', 'elementor' ),
185 'type' => Controls_Manager::SELECT,
186 'options' => [
187 'h1' => 'H1',
188 'h2' => 'H2',
189 'h3' => 'H3',
190 'h4' => 'H4',
191 'h5' => 'H5',
192 'h6' => 'H6',
193 'div' => 'div',
194 'span' => 'span',
195 'p' => 'p',
196 ],
197 'default' => 'h3',
198 ]
199 );
200
201 $this->end_controls_section();
202
203 $this->start_controls_section(
204 'section_style_box',
205 [
206 'label' => esc_html__( 'Box', 'elementor' ),
207 'tab' => Controls_Manager::TAB_STYLE,
208 ]
209 );
210
211 $this->add_responsive_control(
212 'position',
213 [
214 'label' => esc_html__( 'Icon Position', 'elementor' ),
215 'type' => Controls_Manager::CHOOSE,
216 'default' => 'top',
217 'mobile_default' => 'top',
218 'options' => [
219 'left' => [
220 'title' => esc_html__( 'Left', 'elementor' ),
221 'icon' => 'eicon-h-align-left',
222 ],
223 'top' => [
224 'title' => esc_html__( 'Top', 'elementor' ),
225 'icon' => 'eicon-v-align-top',
226 ],
227 'right' => [
228 'title' => esc_html__( 'Right', 'elementor' ),
229 'icon' => 'eicon-h-align-right',
230 ],
231 ],
232 'prefix_class' => 'elementor%s-position-',
233 'condition' => [
234 'selected_icon[value]!' => '',
235 ],
236 ]
237 );
238
239 $this->add_control(
240 'content_vertical_alignment',
241 [
242 'label' => esc_html__( 'Vertical Alignment', 'elementor' ),
243 'type' => Controls_Manager::CHOOSE,
244 'options' => [
245 'top' => [
246 'title' => esc_html__( 'Top', 'elementor' ),
247 'icon' => 'eicon-v-align-top',
248 ],
249 'middle' => [
250 'title' => esc_html__( 'Middle', 'elementor' ),
251 'icon' => 'eicon-v-align-middle',
252 ],
253 'bottom' => [
254 'title' => esc_html__( 'Bottom', 'elementor' ),
255 'icon' => 'eicon-v-align-bottom',
256 ],
257 ],
258 'default' => 'top',
259 'toggle' => false,
260 'prefix_class' => 'elementor-vertical-align-',
261 'condition' => [
262 'position!' => 'top',
263 ],
264 ]
265 );
266
267 $this->add_responsive_control(
268 'text_align',
269 [
270 'label' => esc_html__( 'Alignment', 'elementor' ),
271 'type' => Controls_Manager::CHOOSE,
272 'options' => [
273 'left' => [
274 'title' => esc_html__( 'Left', 'elementor' ),
275 'icon' => 'eicon-text-align-left',
276 ],
277 'center' => [
278 'title' => esc_html__( 'Center', 'elementor' ),
279 'icon' => 'eicon-text-align-center',
280 ],
281 'right' => [
282 'title' => esc_html__( 'Right', 'elementor' ),
283 'icon' => 'eicon-text-align-right',
284 ],
285 'justify' => [
286 'title' => esc_html__( 'Justified', 'elementor' ),
287 'icon' => 'eicon-text-align-justify',
288 ],
289 ],
290 'selectors' => [
291 '{{WRAPPER}} .elementor-icon-box-wrapper' => 'text-align: {{VALUE}};',
292 ],
293 ]
294 );
295
296 $this->end_controls_section();
297
298 $this->start_controls_section(
299 'section_style_icon',
300 [
301 'label' => esc_html__( 'Icon', 'elementor' ),
302 'tab' => Controls_Manager::TAB_STYLE,
303 'condition' => [
304 'selected_icon[value]!' => '',
305 ],
306 ]
307 );
308
309 $this->start_controls_tabs( 'icon_colors' );
310
311 $this->start_controls_tab(
312 'icon_colors_normal',
313 [
314 'label' => esc_html__( 'Normal', 'elementor' ),
315 ]
316 );
317
318 $this->add_control(
319 'primary_color',
320 [
321 'label' => esc_html__( 'Primary Color', 'elementor' ),
322 'type' => Controls_Manager::COLOR,
323 'global' => [
324 'default' => Global_Colors::COLOR_PRIMARY,
325 ],
326 'default' => '',
327 'selectors' => [
328 '{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'background-color: {{VALUE}};',
329 '{{WRAPPER}}.elementor-view-framed .elementor-icon, {{WRAPPER}}.elementor-view-default .elementor-icon' => 'fill: {{VALUE}}; color: {{VALUE}}; border-color: {{VALUE}};',
330 ],
331 ]
332 );
333
334 $this->add_control(
335 'secondary_color',
336 [
337 'label' => esc_html__( 'Secondary Color', 'elementor' ),
338 'type' => Controls_Manager::COLOR,
339 'default' => '',
340 'condition' => [
341 'view!' => 'default',
342 ],
343 'selectors' => [
344 '{{WRAPPER}}.elementor-view-framed .elementor-icon' => 'background-color: {{VALUE}};',
345 '{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'fill: {{VALUE}}; color: {{VALUE}};',
346 ],
347 ]
348 );
349
350 $this->end_controls_tab();
351
352 $this->start_controls_tab(
353 'icon_colors_hover',
354 [
355 'label' => esc_html__( 'Hover', 'elementor' ),
356 ]
357 );
358
359 $this->add_control(
360 'hover_primary_color',
361 [
362 'label' => esc_html__( 'Primary Color', 'elementor' ),
363 'type' => Controls_Manager::COLOR,
364 'default' => '',
365 'selectors' => [
366 '{{WRAPPER}}.elementor-view-stacked .elementor-icon:hover' => 'background-color: {{VALUE}};',
367 '{{WRAPPER}}.elementor-view-framed .elementor-icon:hover, {{WRAPPER}}.elementor-view-default .elementor-icon:hover' => 'fill: {{VALUE}}; color: {{VALUE}}; border-color: {{VALUE}};',
368 ],
369 ]
370 );
371
372 $this->add_control(
373 'hover_secondary_color',
374 [
375 'label' => esc_html__( 'Secondary Color', 'elementor' ),
376 'type' => Controls_Manager::COLOR,
377 'default' => '',
378 'condition' => [
379 'view!' => 'default',
380 ],
381 'selectors' => [
382 '{{WRAPPER}}.elementor-view-framed .elementor-icon:hover' => 'background-color: {{VALUE}};',
383 '{{WRAPPER}}.elementor-view-stacked .elementor-icon:hover' => 'fill: {{VALUE}}; color: {{VALUE}};',
384 ],
385 ]
386 );
387
388 $this->add_control(
389 'hover_animation',
390 [
391 'label' => esc_html__( 'Hover Animation', 'elementor' ),
392 'type' => Controls_Manager::HOVER_ANIMATION,
393 ]
394 );
395
396 $this->end_controls_tab();
397
398 $this->end_controls_tabs();
399
400 $this->add_responsive_control(
401 'icon_space',
402 [
403 'label' => esc_html__( 'Spacing', 'elementor' ),
404 'type' => Controls_Manager::SLIDER,
405 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
406 'default' => [
407 'size' => 15,
408 ],
409 'range' => [
410 'px' => [
411 'min' => 0,
412 'max' => 100,
413 ],
414 ],
415 'selectors' => [
416 '{{WRAPPER}}' => '--icon-box-icon-margin: {{SIZE}}{{UNIT}}',
417 ],
418 ]
419 );
420
421 $this->add_responsive_control(
422 'icon_size',
423 [
424 'label' => esc_html__( 'Size', 'elementor' ),
425 'type' => Controls_Manager::SLIDER,
426 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
427 'range' => [
428 'px' => [
429 'min' => 6,
430 'max' => 300,
431 ],
432 ],
433 'selectors' => [
434 '{{WRAPPER}} .elementor-icon' => 'font-size: {{SIZE}}{{UNIT}};',
435 ],
436 ]
437 );
438
439 $this->add_responsive_control(
440 'icon_padding',
441 [
442 'label' => esc_html__( 'Padding', 'elementor' ),
443 'type' => Controls_Manager::SLIDER,
444 'selectors' => [
445 '{{WRAPPER}} .elementor-icon' => 'padding: {{SIZE}}{{UNIT}};',
446 ],
447 'range' => [
448 'em' => [
449 'min' => 0,
450 'max' => 5,
451 ],
452 ],
453 'condition' => [
454 'view!' => 'default',
455 ],
456 ]
457 );
458
459 $active_breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints();
460
461 $rotate_device_args = [];
462
463 $rotate_device_settings = [
464 'default' => [
465 'unit' => 'deg',
466 ],
467 ];
468
469 foreach ( $active_breakpoints as $breakpoint_name => $breakpoint ) {
470 $rotate_device_args[ $breakpoint_name ] = $rotate_device_settings;
471 }
472
473 $this->add_responsive_control(
474 'rotate',
475 [
476 'label' => esc_html__( 'Rotate', 'elementor' ),
477 'type' => Controls_Manager::SLIDER,
478 'size_units' => [ 'deg', 'grad', 'rad', 'turn', 'custom' ],
479 'default' => [
480 'unit' => 'deg',
481 ],
482 'tablet_default' => [
483 'unit' => 'deg',
484 ],
485 'mobile_default' => [
486 'unit' => 'deg',
487 ],
488 'device_args' => $rotate_device_args,
489 'selectors' => [
490 '{{WRAPPER}} .elementor-icon i' => 'transform: rotate({{SIZE}}{{UNIT}});',
491 ],
492 ]
493 );
494
495 $this->add_responsive_control(
496 'border_width',
497 [
498 'label' => esc_html__( 'Border Width', 'elementor' ),
499 'type' => Controls_Manager::DIMENSIONS,
500 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
501 'selectors' => [
502 '{{WRAPPER}} .elementor-icon' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
503 ],
504 'condition' => [
505 'view' => 'framed',
506 ],
507 ]
508 );
509
510 $this->add_responsive_control(
511 'border_radius',
512 [
513 'label' => esc_html__( 'Border Radius', 'elementor' ),
514 'type' => Controls_Manager::DIMENSIONS,
515 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
516 'selectors' => [
517 '{{WRAPPER}} .elementor-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
518 ],
519 'condition' => [
520 'view!' => 'default',
521 ],
522 ]
523 );
524
525 $this->end_controls_section();
526
527 $this->start_controls_section(
528 'section_style_content',
529 [
530 'label' => esc_html__( 'Content', 'elementor' ),
531 'tab' => Controls_Manager::TAB_STYLE,
532 ]
533 );
534
535 $this->add_control(
536 'heading_title',
537 [
538 'label' => esc_html__( 'Title', 'elementor' ),
539 'type' => Controls_Manager::HEADING,
540 'separator' => 'before',
541 ]
542 );
543
544 $this->add_responsive_control(
545 'title_bottom_space',
546 [
547 'label' => esc_html__( 'Spacing', 'elementor' ),
548 'type' => Controls_Manager::SLIDER,
549 'range' => [
550 'px' => [
551 'min' => 0,
552 'max' => 100,
553 ],
554 ],
555 'selectors' => [
556 '{{WRAPPER}} .elementor-icon-box-title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
557 ],
558 ]
559 );
560
561 $this->add_control(
562 'title_color',
563 [
564 'label' => esc_html__( 'Color', 'elementor' ),
565 'type' => Controls_Manager::COLOR,
566 'default' => '',
567 'selectors' => [
568 '{{WRAPPER}} .elementor-icon-box-title' => 'color: {{VALUE}};',
569 ],
570 'global' => [
571 'default' => Global_Colors::COLOR_PRIMARY,
572 ],
573 ]
574 );
575
576 $this->add_group_control(
577 Group_Control_Typography::get_type(),
578 [
579 'name' => 'title_typography',
580 'selector' => '{{WRAPPER}} .elementor-icon-box-title, {{WRAPPER}} .elementor-icon-box-title a',
581 'global' => [
582 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
583 ],
584 ]
585 );
586
587 $this->add_group_control(
588 Group_Control_Text_Stroke::get_type(),
589 [
590 'name' => 'text_stroke',
591 'selector' => '{{WRAPPER}} .elementor-icon-box-title',
592 ]
593 );
594
595 $this->add_group_control(
596 Group_Control_Text_Shadow::get_type(),
597 [
598 'name' => 'title_shadow',
599 'selector' => '{{WRAPPER}} .elementor-icon-box-title',
600 ]
601 );
602
603 $this->add_control(
604 'heading_description',
605 [
606 'label' => esc_html__( 'Description', 'elementor' ),
607 'type' => Controls_Manager::HEADING,
608 'separator' => 'before',
609 ]
610 );
611
612 $this->add_control(
613 'description_color',
614 [
615 'label' => esc_html__( 'Color', 'elementor' ),
616 'type' => Controls_Manager::COLOR,
617 'default' => '',
618 'selectors' => [
619 '{{WRAPPER}} .elementor-icon-box-description' => 'color: {{VALUE}};',
620 ],
621 'global' => [
622 'default' => Global_Colors::COLOR_TEXT,
623 ],
624 ]
625 );
626
627 $this->add_group_control(
628 Group_Control_Typography::get_type(),
629 [
630 'name' => 'description_typography',
631 'selector' => '{{WRAPPER}} .elementor-icon-box-description',
632 'global' => [
633 'default' => Global_Typography::TYPOGRAPHY_TEXT,
634 ],
635 ]
636 );
637
638 $this->add_group_control(
639 Group_Control_Text_Shadow::get_type(),
640 [
641 'name' => 'description_shadow',
642 'selector' => '{{WRAPPER}} .elementor-icon-box-description',
643 ]
644 );
645
646 $this->end_controls_section();
647 }
648
649 /**
650 * Render icon box widget output on the frontend.
651 *
652 * Written in PHP and used to generate the final HTML.
653 *
654 * @since 1.0.0
655 * @access protected
656 */
657 protected function render() {
658 $settings = $this->get_settings_for_display();
659 $has_link = ! empty( $settings['link']['url'] );
660 $html_tag = $has_link ? 'a' : 'span';
661
662 $this->add_render_attribute( 'icon', 'class', [ 'elementor-icon', 'elementor-animation-' . $settings['hover_animation'] ] );
663
664 if ( ! isset( $settings['icon'] ) && ! Icons_Manager::is_migration_allowed() ) {
665 // add old default
666 $settings['icon'] = 'fa fa-star';
667 }
668
669 $has_icon = ! empty( $settings['icon'] );
670
671 if ( $has_link ) {
672 $this->add_link_attributes( 'link', $settings['link'] );
673 $this->add_render_attribute( 'icon', 'tabindex', '-1' );
674 }
675
676 if ( $has_icon ) {
677 $this->add_render_attribute( 'i', 'class', $settings['icon'] );
678 $this->add_render_attribute( 'i', 'aria-hidden', 'true' );
679 }
680
681 $this->add_render_attribute( 'description_text', 'class', 'elementor-icon-box-description' );
682
683 $this->add_inline_editing_attributes( 'title_text', 'none' );
684 $this->add_inline_editing_attributes( 'description_text' );
685 if ( ! $has_icon && ! empty( $settings['selected_icon']['value'] ) ) {
686 $has_icon = true;
687 }
688 $migrated = isset( $settings['__fa4_migrated']['selected_icon'] );
689 $is_new = ! isset( $settings['icon'] ) && Icons_Manager::is_migration_allowed();
690
691 ?>
692 <div class="elementor-icon-box-wrapper">
693 <?php if ( $has_icon ) : ?>
694 <div class="elementor-icon-box-icon">
695 <<?php Utils::print_validated_html_tag( $html_tag ); ?> <?php $this->print_render_attribute_string( 'link' ); ?> <?php $this->print_render_attribute_string( 'icon' ); ?>>
696 <?php
697 if ( $is_new || $migrated ) {
698 Icons_Manager::render_icon( $settings['selected_icon'], [ 'aria-hidden' => 'true' ] );
699 } elseif ( ! empty( $settings['icon'] ) ) {
700 ?><i <?php $this->print_render_attribute_string( 'i' ); ?>></i><?php
701 }
702 ?>
703 </<?php Utils::print_validated_html_tag( $html_tag ); ?>>
704 </div>
705 <?php endif; ?>
706 <div class="elementor-icon-box-content">
707 <<?php Utils::print_validated_html_tag( $settings['title_size'] ); ?> class="elementor-icon-box-title">
708 <<?php Utils::print_validated_html_tag( $html_tag ); ?> <?php $this->print_render_attribute_string( 'link' ); ?> <?php $this->print_render_attribute_string( 'title_text' ); ?>>
709 <?php $this->print_unescaped_setting( 'title_text' ); ?>
710 </<?php Utils::print_validated_html_tag( $html_tag ); ?>>
711 </<?php Utils::print_validated_html_tag( $settings['title_size'] ); ?>>
712 <?php if ( ! Utils::is_empty( $settings['description_text'] ) ) : ?>
713 <p <?php $this->print_render_attribute_string( 'description_text' ); ?>>
714 <?php $this->print_unescaped_setting( 'description_text' ); ?>
715 </p>
716 <?php endif; ?>
717 </div>
718 </div>
719 <?php
720 }
721
722 /**
723 * Render icon box widget output in the editor.
724 *
725 * Written as a Backbone JavaScript template and used to generate the live preview.
726 *
727 * @since 2.9.0
728 * @access protected
729 */
730 protected function content_template() {
731 ?>
732 <#
733 var hasLink = settings.link.url,
734 htmlTag = hasLink ? 'a' : 'span',
735 iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ),
736 migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' );
737
738 view.addRenderAttribute( 'icon', 'class', 'elementor-icon elementor-animation-' + settings.hover_animation );
739
740 if ( hasLink ) {
741 view.addRenderAttribute( 'link', 'href', settings.link.url );
742 view.addRenderAttribute( 'icon', 'tabindex', '-1' );
743 }
744
745 view.addRenderAttribute( 'description_text', 'class', 'elementor-icon-box-description' );
746
747 view.addInlineEditingAttributes( 'title_text', 'none' );
748 view.addInlineEditingAttributes( 'description_text' );
749 #>
750 <div class="elementor-icon-box-wrapper">
751 <?php // settings.icon is needed for older version ?>
752 <# if ( settings.icon || settings.selected_icon.value ) { #>
753 <div class="elementor-icon-box-icon">
754 <{{{ htmlTag }}} {{{ view.getRenderAttributeString( 'link' ) }}} {{{ view.getRenderAttributeString( 'icon' ) }}}>
755 <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #>
756 {{{ iconHTML.value }}}
757 <# } else { #>
758 <i class="{{ settings.icon }}" aria-hidden="true"></i>
759 <# } #>
760 </{{{ htmlTag }}}>
761 </div>
762 <# } #>
763 <div class="elementor-icon-box-content">
764 <# var titleSizeTag = elementor.helpers.validateHTMLTag( settings.title_size ); #>
765 <{{{ titleSizeTag }}} class="elementor-icon-box-title">
766 <{{{ htmlTag }}} {{{ view.getRenderAttributeString( 'link' ) }}} {{{ view.getRenderAttributeString( 'title_text' ) }}}>
767 {{{ settings.title_text }}}
768 </{{{ htmlTag }}}>
769 </{{{ titleSizeTag }}}>
770 <# if ( settings.description_text ) { #>
771 <p {{{ view.getRenderAttributeString( 'description_text' ) }}}>{{{ settings.description_text }}}</p>
772 <# } #>
773 </div>
774 </div>
775 <?php
776 }
777
778 public function on_import( $element ) {
779 return Icons_Manager::on_import_migration( $element, 'icon', 'selected_icon', true );
780 }
781 }
782