PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.2
Elementor Website Builder – more than just a page builder v3.16.2
4.3.0-beta3 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 All 452 releases
← All changes | includes/widgets/icon-box.php +108 -297 4.0.93.16.2 View file →
@@ -72,31 +72,9 @@
72 72 public function get_keywords() {
73 73 return [ 'icon box', 'icon' ];
74 74 }
75 75
76 - protected function is_dynamic_content(): bool {
77 - return false;
78 - }
79 -
80 - public function has_widget_inner_wrapper(): bool {
81 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
82 - }
83 -
84 76 /**
85 - * Get style dependencies.
86 - *
87 - * Retrieve the list of style dependencies the widget requires.
88 - *
89 - * @since 3.24.0
90 - * @access public
91 - *
92 - * @return array Widget style dependencies.
93 - */
94 - public function get_style_depends(): array {
95 - return [ 'widget-icon-box' ];
96 - }
97 -
98 - /**
99 77 * Register icon box widget controls.
100 78 *
101 79 * Adds different input fields to allow the user to change and customize the widget settings.
102 80 *
@@ -147,11 +125,10 @@
147 125 [
148 126 'label' => esc_html__( 'Shape', 'elementor' ),
149 127 'type' => Controls_Manager::SELECT,
150 128 'options' => [
129 + 'circle' => esc_html__( 'Circle', 'elementor' ),
151 130 'square' => esc_html__( 'Square', 'elementor' ),
152 - 'rounded' => esc_html__( 'Rounded', 'elementor' ),
153 - 'circle' => esc_html__( 'Circle', 'elementor' ),
154 131 ],
155 132 'default' => 'circle',
156 133 'condition' => [
157 134 'view!' => 'default',
@@ -235,35 +212,24 @@
235 212 'position',
236 213 [
237 214 'label' => esc_html__( 'Icon Position', 'elementor' ),
238 215 'type' => Controls_Manager::CHOOSE,
239 - 'default' => 'block-start',
240 - 'mobile_default' => 'block-start',
216 + 'default' => 'top',
217 + 'mobile_default' => 'top',
241 218 'options' => [
242 - 'inline-start' => [
243 - 'title' => esc_html__( 'Start', 'elementor' ),
219 + 'left' => [
220 + 'title' => esc_html__( 'Left', 'elementor' ),
244 221 'icon' => 'eicon-h-align-left',
245 222 ],
246 - 'inline-end' => [
247 - 'title' => esc_html__( 'End', 'elementor' ),
248 - 'icon' => 'eicon-h-align-right',
249 - ],
250 - 'block-start' => [
223 + 'top' => [
251 224 'title' => esc_html__( 'Top', 'elementor' ),
252 225 'icon' => 'eicon-v-align-top',
253 226 ],
254 - 'block-end' => [
255 - 'title' => esc_html__( 'Bottom', 'elementor' ),
256 - 'icon' => 'eicon-v-align-bottom',
227 + 'right' => [
228 + 'title' => esc_html__( 'Right', 'elementor' ),
229 + 'icon' => 'eicon-h-align-right',
257 230 ],
258 231 ],
259 - 'classes' => 'elementor-control-start-end',
260 - 'classes_dictionary' => [
261 - 'left' => is_rtl() ? 'inline-end' : 'inline-start',
262 - 'right' => is_rtl() ? 'inline-start' : 'inline-end',
263 - 'top' => 'block-start',
264 - 'bottom' => 'block-end',
265 - ],
266 232 'prefix_class' => 'elementor%s-position-',
267 233 'condition' => [
268 234 'selected_icon[value]!' => '',
269 235 ],
@@ -269,9 +235,9 @@
269 235 ],
270 236 ]
271 237 );
272 238
273 - $this->add_responsive_control(
239 + $this->add_control(
274 240 'content_vertical_alignment',
275 241 [
276 242 'label' => esc_html__( 'Vertical Alignment', 'elementor' ),
277 243 'type' => Controls_Manager::CHOOSE,
@@ -289,19 +255,12 @@
289 255 'icon' => 'eicon-v-align-bottom',
290 256 ],
291 257 ],
292 258 'default' => 'top',
293 - 'selectors_dictionary' => [
294 - 'top' => 'start',
295 - 'middle' => 'center',
296 - 'bottom' => 'end',
297 - ],
298 - 'selectors' => [
299 - '{{WRAPPER}} .elementor-icon-box-wrapper' => 'align-items: {{VALUE}};',
300 - ],
259 + 'toggle' => false,
260 + 'prefix_class' => 'elementor-vertical-align-',
301 261 'condition' => [
302 - 'selected_icon[value]!' => '',
303 - 'position' => [ 'left', 'right', 'inline-start', 'inline-end' ],
262 + 'position!' => 'top',
304 263 ],
305 264 ]
306 265 );
307 266
@@ -310,10 +269,10 @@
310 269 [
311 270 'label' => esc_html__( 'Alignment', 'elementor' ),
312 271 'type' => Controls_Manager::CHOOSE,
313 272 'options' => [
314 - 'start' => [
315 - 'title' => esc_html__( 'Start', 'elementor' ),
273 + 'left' => [
274 + 'title' => esc_html__( 'Left', 'elementor' ),
316 275 'icon' => 'eicon-text-align-left',
317 276 ],
318 277 'center' => [
319 278 'title' => esc_html__( 'Center', 'elementor' ),
@@ -318,10 +277,10 @@
318 277 'center' => [
319 278 'title' => esc_html__( 'Center', 'elementor' ),
320 279 'icon' => 'eicon-text-align-center',
321 280 ],
322 - 'end' => [
323 - 'title' => esc_html__( 'End', 'elementor' ),
281 + 'right' => [
282 + 'title' => esc_html__( 'Right', 'elementor' ),
324 283 'icon' => 'eicon-text-align-right',
325 284 ],
326 285 'justify' => [
327 286 'title' => esc_html__( 'Justified', 'elementor' ),
@@ -327,74 +286,14 @@
327 286 'title' => esc_html__( 'Justified', 'elementor' ),
328 287 'icon' => 'eicon-text-align-justify',
329 288 ],
330 289 ],
331 - 'classes' => 'elementor-control-start-end',
332 - 'selectors_dictionary' => [
333 - 'left' => is_rtl() ? 'end' : 'start',
334 - 'right' => is_rtl() ? 'start' : 'end',
335 - ],
336 290 'selectors' => [
337 291 '{{WRAPPER}} .elementor-icon-box-wrapper' => 'text-align: {{VALUE}};',
338 292 ],
339 - 'separator' => 'after',
340 293 ]
341 294 );
342 295
343 - $this->add_responsive_control(
344 - 'icon_space',
345 - [
346 - 'label' => esc_html__( 'Icon Spacing', 'elementor' ),
347 - 'type' => Controls_Manager::SLIDER,
348 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
349 - 'default' => [
350 - 'size' => 15,
351 - ],
352 - 'range' => [
353 - 'px' => [
354 - 'max' => 100,
355 - ],
356 - 'em' => [
357 - 'max' => 10,
358 - ],
359 - 'rem' => [
360 - 'max' => 10,
361 - ],
362 - ],
363 - 'selectors' => [
364 - '{{WRAPPER}} .elementor-icon-box-wrapper' => 'gap: {{SIZE}}{{UNIT}};',
365 - ],
366 - 'condition' => [
367 - 'selected_icon[value]!' => '',
368 - ],
369 - ]
370 - );
371 -
372 - $this->add_responsive_control(
373 - 'title_bottom_space',
374 - [
375 - 'label' => esc_html__( 'Content Spacing', 'elementor' ),
376 - 'type' => Controls_Manager::SLIDER,
377 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
378 - 'range' => [
379 - 'px' => [
380 - 'max' => 100,
381 - ],
382 - 'em' => [
383 - 'min' => 0,
384 - 'max' => 10,
385 - ],
386 - 'rem' => [
387 - 'min' => 0,
388 - 'max' => 10,
389 - ],
390 - ],
391 - 'selectors' => [
392 - '{{WRAPPER}} .elementor-icon-box-title' => 'margin-block-end: {{SIZE}}{{UNIT}};',
393 - ],
394 - ]
395 - );
396 -
397 296 $this->end_controls_section();
398 297
399 298 $this->start_controls_section(
400 299 'section_style_icon',
@@ -463,14 +362,10 @@
463 362 'label' => esc_html__( 'Primary Color', 'elementor' ),
464 363 'type' => Controls_Manager::COLOR,
465 364 'default' => '',
466 365 'selectors' => [
467 - '{{WRAPPER}}.elementor-view-stacked:has(:hover) .elementor-icon,
468 - {{WRAPPER}}.elementor-view-stacked:has(:focus) .elementor-icon' => 'background-color: {{VALUE}};',
469 - '{{WRAPPER}}.elementor-view-framed:has(:hover) .elementor-icon,
470 - {{WRAPPER}}.elementor-view-default:has(:hover) .elementor-icon,
471 - {{WRAPPER}}.elementor-view-framed:has(:focus) .elementor-icon,
472 - {{WRAPPER}}.elementor-view-default:has(:focus) .elementor-icon' => 'fill: {{VALUE}}; color: {{VALUE}}; border-color: {{VALUE}};',
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}};',
473 368 ],
474 369 ]
475 370 );
476 371
@@ -483,32 +378,15 @@
483 378 'condition' => [
484 379 'view!' => 'default',
485 380 ],
486 381 'selectors' => [
487 - '{{WRAPPER}}.elementor-view-framed:has(:hover) .elementor-icon,
488 - {{WRAPPER}}.elementor-view-framed:has(:focus) .elementor-icon' => 'background-color: {{VALUE}};',
489 - '{{WRAPPER}}.elementor-view-stacked:has(:hover) .elementor-icon,
490 - {{WRAPPER}}.elementor-view-stacked:has(:focus) .elementor-icon' => 'fill: {{VALUE}}; color: {{VALUE}};',
382 + '{{WRAPPER}}.elementor-view-framed .elementor-icon:hover' => 'background-color: {{VALUE}};',
383 + '{{WRAPPER}}.elementor-view-stacked .elementor-icon:hover' => 'fill: {{VALUE}}; color: {{VALUE}};',
491 384 ],
492 385 ]
493 386 );
494 387
495 388 $this->add_control(
496 - 'hover_icon_colors_transition_duration',
497 - [
498 - 'label' => esc_html__( 'Transition Duration', 'elementor' ),
499 - 'type' => Controls_Manager::SLIDER,
500 - 'size_units' => [ 's', 'ms', 'custom' ],
501 - 'default' => [
502 - 'unit' => 's',
503 - ],
504 - 'selectors' => [
505 - '{{WRAPPER}} .elementor-icon' => 'transition-duration: {{SIZE}}{{UNIT}};',
506 - ],
507 - ]
508 - );
509 -
510 - $this->add_control(
511 389 'hover_animation',
512 390 [
513 391 'label' => esc_html__( 'Hover Animation', 'elementor' ),
514 392 'type' => Controls_Manager::HOVER_ANIMATION,
@@ -519,8 +397,29 @@
519 397
520 398 $this->end_controls_tabs();
521 399
522 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(
523 422 'icon_size',
524 423 [
525 424 'label' => esc_html__( 'Size', 'elementor' ),
526 425 'type' => Controls_Manager::SLIDER,
@@ -541,24 +440,16 @@
541 440 'icon_padding',
542 441 [
543 442 'label' => esc_html__( 'Padding', 'elementor' ),
544 443 'type' => Controls_Manager::SLIDER,
545 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
546 444 'selectors' => [
547 445 '{{WRAPPER}} .elementor-icon' => 'padding: {{SIZE}}{{UNIT}};',
548 446 ],
549 447 'range' => [
550 - 'px' => [
551 - 'max' => 50,
552 - ],
553 448 'em' => [
554 449 'min' => 0,
555 450 'max' => 5,
556 451 ],
557 - 'rem' => [
558 - 'min' => 0,
559 - 'max' => 5,
560 - ],
561 452 ],
562 453 'condition' => [
563 454 'view!' => 'default',
564 455 ],
@@ -627,9 +518,8 @@
627 518 ],
628 519 'condition' => [
629 520 'view!' => 'default',
630 521 ],
631 - 'separator' => 'before',
632 522 ]
633 523 );
634 524
635 525 $this->end_controls_section();
@@ -650,8 +540,40 @@
650 540 'separator' => 'before',
651 541 ]
652 542 );
653 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 +
654 576 $this->add_group_control(
655 577 Group_Control_Typography::get_type(),
656 578 [
657 579 'name' => 'title_typography',
@@ -677,85 +599,32 @@
677 599 'selector' => '{{WRAPPER}} .elementor-icon-box-title',
678 600 ]
679 601 );
680 602
681 - $this->start_controls_tabs( 'icon_box_title_colors' );
682 -
683 - $this->start_controls_tab(
684 - 'icon_box_title_colors_normal',
685 - [
686 - 'label' => esc_html__( 'Normal', 'elementor' ),
687 - ]
688 - );
689 -
690 603 $this->add_control(
691 - 'title_color',
604 + 'heading_description',
692 605 [
693 - 'label' => esc_html__( 'Color', 'elementor' ),
694 - 'type' => Controls_Manager::COLOR,
695 - 'default' => '',
696 - 'selectors' => [
697 - '{{WRAPPER}} .elementor-icon-box-title' => 'color: {{VALUE}};',
698 - ],
699 - 'global' => [
700 - 'default' => Global_Colors::COLOR_PRIMARY,
701 - ],
606 + 'label' => esc_html__( 'Description', 'elementor' ),
607 + 'type' => Controls_Manager::HEADING,
608 + 'separator' => 'before',
702 609 ]
703 610 );
704 611
705 - $this->end_controls_tab();
706 -
707 - $this->start_controls_tab(
708 - 'icon_box_title_colors_hover',
709 - [
710 - 'label' => esc_html__( 'Hover', 'elementor' ),
711 - ]
712 - );
713 -
714 612 $this->add_control(
715 - 'hover_title_color',
613 + 'description_color',
716 614 [
717 615 'label' => esc_html__( 'Color', 'elementor' ),
718 616 'type' => Controls_Manager::COLOR,
719 617 'default' => '',
720 618 'selectors' => [
721 - '{{WRAPPER}}:has(:hover) .elementor-icon-box-title,
722 - {{WRAPPER}}:has(:focus) .elementor-icon-box-title' => 'color: {{VALUE}};',
619 + '{{WRAPPER}} .elementor-icon-box-description' => 'color: {{VALUE}};',
723 620 ],
724 621 'global' => [
725 - 'default' => Global_Colors::COLOR_PRIMARY,
622 + 'default' => Global_Colors::COLOR_TEXT,
726 623 ],
727 624 ]
728 625 );
729 626
730 - $this->add_control(
731 - 'hover_title_color_transition_duration',
732 - [
733 - 'label' => esc_html__( 'Transition Duration', 'elementor' ),
734 - 'type' => Controls_Manager::SLIDER,
735 - 'size_units' => [ 's', 'ms', 'custom' ],
736 - 'default' => [
737 - 'unit' => 's',
738 - ],
739 - 'selectors' => [
740 - '{{WRAPPER}} .elementor-icon-box-title' => 'transition-duration: {{SIZE}}{{UNIT}};',
741 - ],
742 - ]
743 - );
744 -
745 - $this->end_controls_tab();
746 -
747 - $this->end_controls_tabs();
748 -
749 - $this->add_control(
750 - 'heading_description',
751 - [
752 - 'label' => esc_html__( 'Description', 'elementor' ),
753 - 'type' => Controls_Manager::HEADING,
754 - 'separator' => 'before',
755 - ]
756 - );
757 -
758 627 $this->add_group_control(
759 628 Group_Control_Typography::get_type(),
760 629 [
761 630 'name' => 'description_typography',
@@ -773,23 +642,8 @@
773 642 'selector' => '{{WRAPPER}} .elementor-icon-box-description',
774 643 ]
775 644 );
776 645
777 - $this->add_control(
778 - 'description_color',
779 - [
780 - 'label' => esc_html__( 'Color', 'elementor' ),
781 - 'type' => Controls_Manager::COLOR,
782 - 'default' => '',
783 - 'selectors' => [
784 - '{{WRAPPER}} .elementor-icon-box-description' => 'color: {{VALUE}};',
785 - ],
786 - 'global' => [
787 - 'default' => Global_Colors::COLOR_TEXT,
788 - ],
789 - ]
790 - );
791 -
792 646 $this->end_controls_section();
793 647 }
794 648
795 649 /**
@@ -804,35 +658,23 @@
804 658 $settings = $this->get_settings_for_display();
805 659 $has_link = ! empty( $settings['link']['url'] );
806 660 $html_tag = $has_link ? 'a' : 'span';
807 661
808 - $this->add_render_attribute( 'icon', 'class', 'elementor-icon' );
662 + $this->add_render_attribute( 'icon', 'class', [ 'elementor-icon', 'elementor-animation-' . $settings['hover_animation'] ] );
809 663
810 - if ( ! empty( $settings['hover_animation'] ) ) {
811 - $this->add_render_attribute( 'icon', 'class', 'elementor-animation-' . $settings['hover_animation'] );
664 + if ( ! isset( $settings['icon'] ) && ! Icons_Manager::is_migration_allowed() ) {
665 + // add old default
666 + $settings['icon'] = 'fa fa-star';
812 667 }
813 668
814 - $has_icon = ! empty( $settings['selected_icon']['value'] );
815 - $has_content = ! Utils::is_empty( $settings['title_text'] ) || ! Utils::is_empty( $settings['description_text'] );
669 + $has_icon = ! empty( $settings['icon'] );
816 670
817 - if ( ! $has_icon && ! $has_content ) {
818 - return;
819 - }
820 -
821 671 if ( $has_link ) {
822 672 $this->add_link_attributes( 'link', $settings['link'] );
823 673 $this->add_render_attribute( 'icon', 'tabindex', '-1' );
824 - if ( ! empty( $settings['title_text'] ) ) {
825 - $this->add_render_attribute( 'icon', 'aria-label', $settings['title_text'] );
826 - }
827 674 }
828 675
829 - if ( ! isset( $settings['icon'] ) && ! Icons_Manager::is_migration_allowed() ) {
830 - // add old default
831 - $settings['icon'] = 'fa fa-star';
832 - }
833 -
834 - if ( ! empty( $settings['icon'] ) ) {
676 + if ( $has_icon ) {
835 677 $this->add_render_attribute( 'i', 'class', $settings['icon'] );
836 678 $this->add_render_attribute( 'i', 'aria-hidden', 'true' );
837 679 }
838 680
@@ -839,14 +681,16 @@
839 681 $this->add_render_attribute( 'description_text', 'class', 'elementor-icon-box-description' );
840 682
841 683 $this->add_inline_editing_attributes( 'title_text', 'none' );
842 684 $this->add_inline_editing_attributes( 'description_text' );
843 -
685 + if ( ! $has_icon && ! empty( $settings['selected_icon']['value'] ) ) {
686 + $has_icon = true;
687 + }
844 688 $migrated = isset( $settings['__fa4_migrated']['selected_icon'] );
845 689 $is_new = ! isset( $settings['icon'] ) && Icons_Manager::is_migration_allowed();
690 +
846 691 ?>
847 692 <div class="elementor-icon-box-wrapper">
848 -
849 693 <?php if ( $has_icon ) : ?>
850 694 <div class="elementor-icon-box-icon">
851 695 <<?php Utils::print_validated_html_tag( $html_tag ); ?> <?php $this->print_render_attribute_string( 'link' ); ?> <?php $this->print_render_attribute_string( 'icon' ); ?>>
852 696 <?php
@@ -858,29 +702,20 @@
858 702 ?>
859 703 </<?php Utils::print_validated_html_tag( $html_tag ); ?>>
860 704 </div>
861 705 <?php endif; ?>
862 -
863 - <?php if ( $has_content ) : ?>
864 706 <div class="elementor-icon-box-content">
865 -
866 - <?php if ( ! Utils::is_empty( $settings['title_text'] ) ) : ?>
867 - <<?php Utils::print_validated_html_tag( $settings['title_size'] ); ?> class="elementor-icon-box-title">
868 - <<?php Utils::print_validated_html_tag( $html_tag ); ?> <?php $this->print_render_attribute_string( 'link' ); ?> <?php $this->print_render_attribute_string( 'title_text' ); ?>>
869 - <?php echo wp_kses_post( $settings['title_text'] ); ?>
870 - </<?php Utils::print_validated_html_tag( $html_tag ); ?>>
871 - </<?php Utils::print_validated_html_tag( $settings['title_size'] ); ?>>
872 - <?php endif; ?>
873 -
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'] ); ?>>
874 712 <?php if ( ! Utils::is_empty( $settings['description_text'] ) ) : ?>
875 713 <p <?php $this->print_render_attribute_string( 'description_text' ); ?>>
876 - <?php echo wp_kses_post( $settings['description_text'] ); ?>
714 + <?php $this->print_unescaped_setting( 'description_text' ); ?>
877 715 </p>
878 716 <?php endif; ?>
879 -
880 717 </div>
881 - <?php endif; ?>
882 -
883 718 </div>
884 719 <?php
885 720 }
886 721
@@ -894,34 +729,18 @@
894 729 */
895 730 protected function content_template() {
896 731 ?>
897 732 <#
898 - // For older version `settings.icon` is needed.
899 - var hasIcon = settings.icon || settings.selected_icon.value;
900 - var hasContent = settings.title_text || settings.description_text;
901 -
902 - if ( ! hasIcon && ! hasContent ) {
903 - return;
904 - }
905 -
906 - var hasLink = settings.link?.url,
733 + var hasLink = settings.link.url,
907 734 htmlTag = hasLink ? 'a' : 'span',
908 735 iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ),
909 - migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ),
910 - titleSizeTag = elementor.helpers.validateHTMLTag( settings.title_size );
736 + migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' );
911 737
912 - view.addRenderAttribute( 'icon', 'class', 'elementor-icon' );
738 + view.addRenderAttribute( 'icon', 'class', 'elementor-icon elementor-animation-' + settings.hover_animation );
913 739
914 - if ( '' !== settings.hover_animation ) {
915 - view.addRenderAttribute( 'icon', 'class', 'elementor-animation-' + settings.hover_animation );
916 - }
917 -
918 740 if ( hasLink ) {
919 - view.addRenderAttribute( 'link', 'href', elementor.helpers.sanitizeUrl( settings.link?.url ) );
741 + view.addRenderAttribute( 'link', 'href', settings.link.url );
920 742 view.addRenderAttribute( 'icon', 'tabindex', '-1' );
921 - if ( '' !== settings.title_text ) {
922 - view.addRenderAttribute( 'icon', 'aria-label', settings.title_text );
923 - }
924 743 }
925 744
926 745 view.addRenderAttribute( 'description_text', 'class', 'elementor-icon-box-description' );
927 746
@@ -928,39 +747,31 @@
928 747 view.addInlineEditingAttributes( 'title_text', 'none' );
929 748 view.addInlineEditingAttributes( 'description_text' );
930 749 #>
931 750 <div class="elementor-icon-box-wrapper">
932 -
933 - <# if ( hasIcon ) { #>
751 + <?php // settings.icon is needed for older version ?>
752 + <# if ( settings.icon || settings.selected_icon.value ) { #>
934 753 <div class="elementor-icon-box-icon">
935 754 <{{{ htmlTag }}} {{{ view.getRenderAttributeString( 'link' ) }}} {{{ view.getRenderAttributeString( 'icon' ) }}}>
936 755 <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #>
937 - {{{ elementor.helpers.sanitize( iconHTML.value ) }}}
756 + {{{ iconHTML.value }}}
938 757 <# } else { #>
939 - <i class="{{ _.escape( settings.icon ) }}" aria-hidden="true"></i>
758 + <i class="{{ settings.icon }}" aria-hidden="true"></i>
940 759 <# } #>
941 760 </{{{ htmlTag }}}>
942 761 </div>
943 762 <# } #>
944 -
945 - <# if ( hasContent ) { #>
946 763 <div class="elementor-icon-box-content">
947 -
948 - <# if ( settings.title_text ) { #>
764 + <# var titleSizeTag = elementor.helpers.validateHTMLTag( settings.title_size ); #>
949 765 <{{{ titleSizeTag }}} class="elementor-icon-box-title">
950 766 <{{{ htmlTag }}} {{{ view.getRenderAttributeString( 'link' ) }}} {{{ view.getRenderAttributeString( 'title_text' ) }}}>
951 - {{{ elementor.helpers.sanitize( settings.title_text ) }}}
767 + {{{ settings.title_text }}}
952 768 </{{{ htmlTag }}}>
953 769 </{{{ titleSizeTag }}}>
954 - <# } #>
955 -
956 770 <# if ( settings.description_text ) { #>
957 - <p {{{ view.getRenderAttributeString( 'description_text' ) }}}>{{{ elementor.helpers.sanitize( settings.description_text ) }}}</p>
771 + <p {{{ view.getRenderAttributeString( 'description_text' ) }}}>{{{ settings.description_text }}}</p>
958 772 <# } #>
959 -
960 773 </div>
961 - <# } #>
962 -
963 774 </div>
964 775 <?php
965 776 }
966 777