PluginProbe
Elementor Website Builder – more than just a page builder / 3.19.2
Elementor Website Builder – more than just a page builder v3.19.2
4.3.1 4.3.0 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 All 454 releases
← All changes | includes/widgets/icon-box.php +121 -308 4.3.13.19.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 ],
@@ -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,35 @@
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 + 'max' => 100,
412 + ],
413 + 'em' => [
414 + 'max' => 10,
415 + ],
416 + 'rem' => [
417 + 'max' => 10,
418 + ],
419 + ],
420 + 'selectors' => [
421 + '{{WRAPPER}}' => '--icon-box-icon-margin: {{SIZE}}{{UNIT}}',
422 + ],
423 + 'separator' => 'before',
424 + ]
425 + );
426 +
427 + $this->add_responsive_control(
523 428 'icon_size',
524 429 [
525 430 'label' => esc_html__( 'Size', 'elementor' ),
526 431 'type' => Controls_Manager::SLIDER,
@@ -650,8 +555,48 @@
650 555 'separator' => 'before',
651 556 ]
652 557 );
653 558
559 + $this->add_responsive_control(
560 + 'title_bottom_space',
561 + [
562 + 'label' => esc_html__( 'Spacing', 'elementor' ),
563 + 'type' => Controls_Manager::SLIDER,
564 + 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
565 + 'range' => [
566 + 'px' => [
567 + 'max' => 100,
568 + ],
569 + 'em' => [
570 + 'min' => 0,
571 + 'max' => 10,
572 + ],
573 + 'rem' => [
574 + 'min' => 0,
575 + 'max' => 10,
576 + ],
577 + ],
578 + 'selectors' => [
579 + '{{WRAPPER}} .elementor-icon-box-title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
580 + ],
581 + ]
582 + );
583 +
584 + $this->add_control(
585 + 'title_color',
586 + [
587 + 'label' => esc_html__( 'Color', 'elementor' ),
588 + 'type' => Controls_Manager::COLOR,
589 + 'default' => '',
590 + 'selectors' => [
591 + '{{WRAPPER}} .elementor-icon-box-title' => 'color: {{VALUE}};',
592 + ],
593 + 'global' => [
594 + 'default' => Global_Colors::COLOR_PRIMARY,
595 + ],
596 + ]
597 + );
598 +
654 599 $this->add_group_control(
655 600 Group_Control_Typography::get_type(),
656 601 [
657 602 'name' => 'title_typography',
@@ -677,85 +622,32 @@
677 622 'selector' => '{{WRAPPER}} .elementor-icon-box-title',
678 623 ]
679 624 );
680 625
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 626 $this->add_control(
691 - 'title_color',
627 + 'heading_description',
692 628 [
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 - ],
629 + 'label' => esc_html__( 'Description', 'elementor' ),
630 + 'type' => Controls_Manager::HEADING,
631 + 'separator' => 'before',
702 632 ]
703 633 );
704 634
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 635 $this->add_control(
715 - 'hover_title_color',
636 + 'description_color',
716 637 [
717 638 'label' => esc_html__( 'Color', 'elementor' ),
718 639 'type' => Controls_Manager::COLOR,
719 640 'default' => '',
720 641 'selectors' => [
721 - '{{WRAPPER}}:has(:hover) .elementor-icon-box-title,
722 - {{WRAPPER}}:has(:focus) .elementor-icon-box-title' => 'color: {{VALUE}};',
642 + '{{WRAPPER}} .elementor-icon-box-description' => 'color: {{VALUE}};',
723 643 ],
724 644 'global' => [
725 - 'default' => Global_Colors::COLOR_PRIMARY,
645 + 'default' => Global_Colors::COLOR_TEXT,
726 646 ],
727 647 ]
728 648 );
729 649
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 650 $this->add_group_control(
759 651 Group_Control_Typography::get_type(),
760 652 [
761 653 'name' => 'description_typography',
@@ -773,23 +665,8 @@
773 665 'selector' => '{{WRAPPER}} .elementor-icon-box-description',
774 666 ]
775 667 );
776 668
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 669 $this->end_controls_section();
793 670 }
794 671
795 672 /**
@@ -804,35 +681,23 @@
804 681 $settings = $this->get_settings_for_display();
805 682 $has_link = ! empty( $settings['link']['url'] );
806 683 $html_tag = $has_link ? 'a' : 'span';
807 684
808 - $this->add_render_attribute( 'icon', 'class', 'elementor-icon' );
685 + $this->add_render_attribute( 'icon', 'class', [ 'elementor-icon', 'elementor-animation-' . $settings['hover_animation'] ] );
809 686
810 - if ( ! empty( $settings['hover_animation'] ) ) {
811 - $this->add_render_attribute( 'icon', 'class', 'elementor-animation-' . $settings['hover_animation'] );
687 + if ( ! isset( $settings['icon'] ) && ! Icons_Manager::is_migration_allowed() ) {
688 + // add old default
689 + $settings['icon'] = 'fa fa-star';
812 690 }
813 691
814 - $has_icon = ! empty( $settings['selected_icon']['value'] );
815 - $has_content = ! Utils::is_empty( $settings['title_text'] ) || ! Utils::is_empty( $settings['description_text'] );
692 + $has_icon = ! empty( $settings['icon'] );
816 693
817 - if ( ! $has_icon && ! $has_content ) {
818 - return;
819 - }
820 -
821 694 if ( $has_link ) {
822 695 $this->add_link_attributes( 'link', $settings['link'] );
823 696 $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 697 }
828 698
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'] ) ) {
699 + if ( $has_icon ) {
835 700 $this->add_render_attribute( 'i', 'class', $settings['icon'] );
836 701 $this->add_render_attribute( 'i', 'aria-hidden', 'true' );
837 702 }
838 703
@@ -839,14 +704,16 @@
839 704 $this->add_render_attribute( 'description_text', 'class', 'elementor-icon-box-description' );
840 705
841 706 $this->add_inline_editing_attributes( 'title_text', 'none' );
842 707 $this->add_inline_editing_attributes( 'description_text' );
843 -
708 + if ( ! $has_icon && ! empty( $settings['selected_icon']['value'] ) ) {
709 + $has_icon = true;
710 + }
844 711 $migrated = isset( $settings['__fa4_migrated']['selected_icon'] );
845 712 $is_new = ! isset( $settings['icon'] ) && Icons_Manager::is_migration_allowed();
713 +
846 714 ?>
847 715 <div class="elementor-icon-box-wrapper">
848 -
849 716 <?php if ( $has_icon ) : ?>
850 717 <div class="elementor-icon-box-icon">
851 718 <<?php Utils::print_validated_html_tag( $html_tag ); ?> <?php $this->print_render_attribute_string( 'link' ); ?> <?php $this->print_render_attribute_string( 'icon' ); ?>>
852 719 <?php
@@ -858,29 +725,20 @@
858 725 ?>
859 726 </<?php Utils::print_validated_html_tag( $html_tag ); ?>>
860 727 </div>
861 728 <?php endif; ?>
862 -
863 - <?php if ( $has_content ) : ?>
864 729 <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 -
730 + <<?php Utils::print_validated_html_tag( $settings['title_size'] ); ?> class="elementor-icon-box-title">
731 + <<?php Utils::print_validated_html_tag( $html_tag ); ?> <?php $this->print_render_attribute_string( 'link' ); ?> <?php $this->print_render_attribute_string( 'title_text' ); ?>>
732 + <?php $this->print_unescaped_setting( 'title_text' ); ?>
733 + </<?php Utils::print_validated_html_tag( $html_tag ); ?>>
734 + </<?php Utils::print_validated_html_tag( $settings['title_size'] ); ?>>
874 735 <?php if ( ! Utils::is_empty( $settings['description_text'] ) ) : ?>
875 736 <p <?php $this->print_render_attribute_string( 'description_text' ); ?>>
876 - <?php echo wp_kses_post( $settings['description_text'] ); ?>
737 + <?php $this->print_unescaped_setting( 'description_text' ); ?>
877 738 </p>
878 739 <?php endif; ?>
879 -
880 740 </div>
881 - <?php endif; ?>
882 -
883 741 </div>
884 742 <?php
885 743 }
886 744
@@ -894,34 +752,18 @@
894 752 */
895 753 protected function content_template() {
896 754 ?>
897 755 <#
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,
756 + var hasLink = settings.link.url,
907 757 htmlTag = hasLink ? 'a' : 'span',
908 758 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 );
759 + migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' );
911 760
912 - view.addRenderAttribute( 'icon', 'class', 'elementor-icon' );
761 + view.addRenderAttribute( 'icon', 'class', 'elementor-icon elementor-animation-' + settings.hover_animation );
913 762
914 - if ( '' !== settings.hover_animation ) {
915 - view.addRenderAttribute( 'icon', 'class', 'elementor-animation-' + settings.hover_animation );
916 - }
917 -
918 763 if ( hasLink ) {
919 - view.addRenderAttribute( 'link', 'href', elementor.helpers.sanitizeUrl( settings.link?.url ) );
764 + view.addRenderAttribute( 'link', 'href', settings.link.url );
920 765 view.addRenderAttribute( 'icon', 'tabindex', '-1' );
921 - if ( '' !== settings.title_text ) {
922 - view.addRenderAttribute( 'icon', 'aria-label', settings.title_text );
923 - }
924 766 }
925 767
926 768 view.addRenderAttribute( 'description_text', 'class', 'elementor-icon-box-description' );
927 769
@@ -928,39 +770,31 @@
928 770 view.addInlineEditingAttributes( 'title_text', 'none' );
929 771 view.addInlineEditingAttributes( 'description_text' );
930 772 #>
931 773 <div class="elementor-icon-box-wrapper">
932 -
933 - <# if ( hasIcon ) { #>
774 + <?php // settings.icon is needed for older version ?>
775 + <# if ( settings.icon || settings.selected_icon.value ) { #>
934 776 <div class="elementor-icon-box-icon">
935 777 <{{{ htmlTag }}} {{{ view.getRenderAttributeString( 'link' ) }}} {{{ view.getRenderAttributeString( 'icon' ) }}}>
936 778 <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #>
937 - {{{ elementor.helpers.sanitize( iconHTML.value ) }}}
779 + {{{ iconHTML.value }}}
938 780 <# } else { #>
939 - <i class="{{ _.escape( settings.icon ) }}" aria-hidden="true"></i>
781 + <i class="{{ settings.icon }}" aria-hidden="true"></i>
940 782 <# } #>
941 783 </{{{ htmlTag }}}>
942 784 </div>
943 785 <# } #>
944 -
945 - <# if ( hasContent ) { #>
946 786 <div class="elementor-icon-box-content">
947 -
948 - <# if ( settings.title_text ) { #>
787 + <# var titleSizeTag = elementor.helpers.validateHTMLTag( settings.title_size ); #>
949 788 <{{{ titleSizeTag }}} class="elementor-icon-box-title">
950 789 <{{{ htmlTag }}} {{{ view.getRenderAttributeString( 'link' ) }}} {{{ view.getRenderAttributeString( 'title_text' ) }}}>
951 - {{{ elementor.helpers.sanitize( settings.title_text ) }}}
790 + {{{ settings.title_text }}}
952 791 </{{{ htmlTag }}}>
953 792 </{{{ titleSizeTag }}}>
954 - <# } #>
955 -
956 793 <# if ( settings.description_text ) { #>
957 - <p {{{ view.getRenderAttributeString( 'description_text' ) }}}>{{{ elementor.helpers.sanitize( settings.description_text ) }}}</p>
794 + <p {{{ view.getRenderAttributeString( 'description_text' ) }}}>{{{ settings.description_text }}}</p>
958 795 <# } #>
959 -
960 796 </div>
961 - <# } #>
962 -
963 797 </div>
964 798 <?php
965 799 }
966 800
@@ -965,27 +799,6 @@
965 799 }
966 800
967 801 public function on_import( $element ) {
968 802 return Icons_Manager::on_import_migration( $element, 'icon', 'selected_icon', true );
969 - }
970 -
971 - public function render_markdown(): string {
972 - $settings = $this->get_settings_for_display();
973 - $title = Utils::html_to_plain_text( $settings['title_text'] ?? '' );
974 - $description = Utils::html_to_plain_text( $settings['description_text'] ?? '' );
975 - if ( empty( $title ) && empty( $description ) ) {
976 - return '';
977 - }
978 - $parts = [];
979 - if ( ! empty( $title ) ) {
980 - if ( ! empty( $settings['link']['url'] ) ) {
981 - $parts[] = '### [' . $title . '](' . esc_url( $settings['link']['url'] ) . ')';
982 - } else {
983 - $parts[] = '### ' . $title;
984 - }
985 - }
986 - if ( ! empty( $description ) ) {
987 - $parts[] = $description;
988 - }
989 - return implode( "\n\n", $parts );
990 803 }
991 804 }