PluginProbe
UiCore Elements – Free widgets and templates for Elementor / 1.3.18
UiCore Elements – Free widgets and templates for Elementor v1.3.18
1.3.18 1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 All 42 releases
← All changes | includes/widgets/icon-list.php +345 -307 1.0.2 → 1.3.18 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 namespace UiCoreElements;
3 4
4 5 use Elementor\Repeater;
5 6 use Elementor\Controls_Manager;
@@ -41,14 +42,19 @@
41 42 return ['uicore'];
42 43 }
43 44 public function get_styles()
44 45 {
45 - return ['icon-list'];
46 + return ['icon-list'];
46 47 }
47 48 public function get_scripts()
48 49 {
49 50 return [];
50 51 }
52 + public function has_widget_inner_wrapper(): bool
53 + {
54 + // TODO: remove after Optmized Markup experiment is merged to the core
55 + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup');
56 + }
51 57 public function get_keywords()
52 58 {
53 59 return ['icon', 'list', 'uicore'];
54 60 }
@@ -61,8 +67,23 @@
61 67 'label' => esc_html__('Items', 'uicore-elements'),
62 68 ]
63 69 );
64 70
71 + $this->add_control(
72 + 'padding_by_dimensions',
73 + [
74 + 'type' => Controls_Manager::NOTICE,
75 + 'notice_type' => 'warning',
76 + 'dismissible' => true,
77 + 'heading' => esc_html__("Number Count styles update", 'uicore-elements'),
78 + 'content' => esc_html__('The Number Count padding control was replaced by width/height controls. Please, check your widgets numbers styles.', 'uicore-elements'),
79 + 'condition' => [
80 + 'show_number_icon' => 'yes',
81 + ]
82 + ]
83 + );
84 +
85 +
65 86 $repeater = new Repeater();
66 87
67 88 $repeater->add_control(
68 89 'text',
@@ -98,11 +119,11 @@
98 119 'type' => Controls_Manager::ICONS,
99 120 'label_block' => false,
100 121 'skin' => 'inline',
101 122 'default' => [
102 - 'value' => 'fas fa-check',
103 - 'library' => 'fa-solid',
104 - ],
123 + 'value' => 'fas fa-check',
124 + 'library' => 'fa-solid',
125 + ],
105 126 ]
106 127 );
107 128
108 129 $repeater->add_control(
@@ -122,14 +143,14 @@
122 143 'link',
123 144 [
124 145 'label' => esc_html__('Link', 'uicore-elements'),
125 146 'type' => Controls_Manager::URL,
126 - 'options' => [ 'url', 'is_external', 'nofollow' ],
127 - 'default' => [
128 - 'url' => '',
129 - 'is_external' => false,
130 - 'nofollow' => false,
131 - ],
147 + 'options' => ['url', 'is_external', 'nofollow'],
148 + 'default' => [
149 + 'url' => '',
150 + 'is_external' => false,
151 + 'nofollow' => false,
152 + ],
132 153 'dynamic' => [
133 154 'active' => true,
134 155 ],
135 156 'label_block' => true,
@@ -172,9 +193,8 @@
172 193 '4' => '4',
173 194 '5' => '5',
174 195 '6' => '6',
175 196 ],
176 - 'render_type' => 'template',
177 197 'selectors' => [
178 198 '{{WRAPPER}} ul' => 'grid-template-columns: repeat({{SIZE}}, 1fr);',
179 199 ],
180 200 'separator' => 'before',
@@ -192,13 +212,13 @@
192 212 'max' => 50,
193 213 ],
194 214 ],
195 215 'default' => [
196 - 'unit' => 'px',
197 - 'size' => 10,
198 - ],
216 + 'unit' => 'px',
217 + 'size' => 10,
218 + ],
199 219 'selectors' => [
200 - '{{WRAPPER}} li' => '--ui-e-grid-gap: {{SIZE}}{{UNIT}};',
220 + '{{WRAPPER}}' => '--ui-e-grid-gap: {{SIZE}}{{UNIT}};',
201 221 ],
202 222 ]
203 223 );
204 224
@@ -274,9 +294,9 @@
274 294 'title' => esc_html__('Right', 'uicore-elements'),
275 295 'icon' => 'eicon-h-align-right',
276 296 ],
277 297 ],
278 - 'default' => 'left',
298 + 'default' => is_rtl() ? 'right' : 'left',
279 299 'prefix_class' => 'ui-e-icon-',
280 300 'separator' => 'before'
281 301 ]
282 302 );
@@ -307,35 +327,35 @@
307 327 ],
308 328 ]
309 329 );
310 330
311 - $this->add_control(
312 - 'vertical_alignment_offset',
313 - [
314 - 'label' => esc_html__( 'Vertical Alignment Offset', 'uicore-elements' ),
315 - 'type' => \Elementor\Controls_Manager::SLIDER,
316 - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
317 - 'range' => [
318 - 'px' => [
319 - 'min' => -25,
320 - 'max' => 25,
321 - 'step' => 1,
322 - ],
323 - '%' => [
324 - 'min' => -100,
325 - 'max' => 100,
331 + $this->add_responsive_control(
332 + 'vertical_alignment_offset',
333 + [
334 + 'label' => esc_html__('Vertical Alignment Offset', 'uicore-elements'),
335 + 'type' => \Elementor\Controls_Manager::SLIDER,
336 + 'size_units' => ['px', '%', 'em', 'rem', 'custom'],
337 + 'range' => [
338 + 'px' => [
339 + 'min' => -25,
340 + 'max' => 25,
341 + 'step' => 1,
342 + ],
343 + '%' => [
344 + 'min' => -100,
345 + 'max' => 100,
326 346 'step' => 5,
327 - ],
328 - ],
347 + ],
348 + ],
329 349 'default' => [
330 350 'size' => 0,
331 351 'unit' => 'px',
332 352 ],
333 - 'selectors' => [
334 - '{{WRAPPER}} .ui-e-icon' => 'transform: translate3d(0,{{SIZE}}{{UNIT}},0);',
335 - ],
336 - ]
337 - );
353 + 'selectors' => [
354 + '{{WRAPPER}} .ui-e-icon' => 'transform: translate3d(0,{{SIZE}}{{UNIT}},0);',
355 + ],
356 + ]
357 + );
338 358
339 359 $this->add_control(
340 360 'content_position',
341 361 [
@@ -402,35 +422,35 @@
402 422 'label' => esc_html__('Normal', 'uicore-elements'),
403 423 ]
404 424 );
405 425
406 - $this->add_group_control(
407 - Group_Control_Background::get_type(),
408 - [
409 - 'name' => 'list_item_bg_color',
410 - 'selector' => '{{WRAPPER}} .ui-e-wrap',
411 - ]
412 - );
426 + $this->add_group_control(
427 + Group_Control_Background::get_type(),
428 + [
429 + 'name' => 'list_item_bg_color',
430 + 'selector' => '{{WRAPPER}} .ui-e-wrap',
431 + ]
432 + );
413 433
414 - $this->add_group_control(
415 - Group_Control_Border::get_type(),
416 - [
417 - 'name' => 'list_item_border',
418 - 'label' => esc_html__('Border', 'uicore-elements'),
419 - 'selector' => '{{WRAPPER}} .ui-e-wrap',
420 - ]
421 - );
434 + $this->add_group_control(
435 + Group_Control_Border::get_type(),
436 + [
437 + 'name' => 'list_item_border',
438 + 'label' => esc_html__('Border', 'uicore-elements'),
439 + 'selector' => '{{WRAPPER}} .ui-e-wrap',
440 + ]
441 + );
422 442
423 - $this->add_group_control(
424 - Group_Control_Box_Shadow::get_type(),
425 - [
426 - 'name' => 'list_item_box_shadow',
427 - 'label' => esc_html__('Box Shadow', 'uicore-elements'),
428 - 'selector' => '{{WRAPPER}} .ui-e-wrap',
429 - ]
430 - );
443 + $this->add_group_control(
444 + Group_Control_Box_Shadow::get_type(),
445 + [
446 + 'name' => 'list_item_box_shadow',
447 + 'label' => esc_html__('Box Shadow', 'uicore-elements'),
448 + 'selector' => '{{WRAPPER}} .ui-e-wrap',
449 + ]
450 + );
431 451
432 - $this->end_controls_tab();
452 + $this->end_controls_tab();
433 453
434 454 $this->start_controls_tab(
435 455 'list_item_tabs_hover',
436 456 [
@@ -437,60 +457,60 @@
437 457 'label' => esc_html__('Hover', 'uicore-elements'),
438 458 ]
439 459 );
440 460
441 - $this->add_group_control(
442 - Group_Control_Background::get_type(),
443 - [
444 - 'name' => 'list_item_hover_bg_color',
445 - 'selector' => '{{WRAPPER}} .ui-e-wrap:hover',
446 - ]
447 - );
461 + $this->add_group_control(
462 + Group_Control_Background::get_type(),
463 + [
464 + 'name' => 'list_item_hover_bg_color',
465 + 'selector' => '{{WRAPPER}} .ui-e-wrap:hover',
466 + ]
467 + );
448 468
449 - $this->add_control(
450 - 'list_item_hover_border',
451 - [
452 - 'label' => esc_html__('Border Color', 'uicore-elements'),
453 - 'type' => Controls_Manager::COLOR,
454 - 'selectors' => [
455 - '{{WRAPPER}} .ui-e-wrap:hover' => 'border-color: {{VALUE}} !important',
456 - ],
457 - 'condition' => [
458 - 'list_item_border_border!' => ''
459 - ]
469 + $this->add_control(
470 + 'list_item_hover_border',
471 + [
472 + 'label' => esc_html__('Border Color', 'uicore-elements'),
473 + 'type' => Controls_Manager::COLOR,
474 + 'selectors' => [
475 + '{{WRAPPER}} .ui-e-wrap:hover' => 'border-color: {{VALUE}} !important',
476 + ],
477 + 'condition' => [
478 + 'list_item_border_border!' => ''
460 479 ]
461 - );
480 + ]
481 + );
462 482
463 - $this->add_group_control(
464 - Group_Control_Box_Shadow::get_type(),
465 - [
466 - 'name' => 'list_item_box_shadow_hover',
467 - 'label' => esc_html__('Box Shadow', 'uicore-elements'),
468 - 'selector' => '{{WRAPPER}} .ui-e-wrap:hover',
469 - ]
470 - );
483 + $this->add_group_control(
484 + Group_Control_Box_Shadow::get_type(),
485 + [
486 + 'name' => 'list_item_box_shadow_hover',
487 + 'label' => esc_html__('Box Shadow', 'uicore-elements'),
488 + 'selector' => '{{WRAPPER}} .ui-e-wrap:hover',
489 + ]
490 + );
471 491
472 - $this->add_responsive_control(
473 - 'list_item_transition',
474 - [
475 - 'label' => esc_html__('Transition', 'uicore-elements'),
476 - 'type' => Controls_Manager::SLIDER,
477 - 'size_units' => ['s'],
478 - 'range' => [
479 - 's' => [
480 - 'min' => 0.01,
481 - 'max' => 1,
482 - ],
492 + $this->add_responsive_control(
493 + 'list_item_transition',
494 + [
495 + 'label' => esc_html__('Transition', 'uicore-elements'),
496 + 'type' => Controls_Manager::SLIDER,
497 + 'size_units' => ['s'],
498 + 'range' => [
499 + 's' => [
500 + 'min' => 0.01,
501 + 'max' => 1,
483 502 ],
484 - 'default' => [
485 - 'unit' => 's',
486 - 'size' => 0.2,
487 - ],
488 - 'selectors' => [
489 - '{{WRAPPER}} .ui-e-wrap' => '--ui-e-transition: {{SIZE}}{{UNIT}}',
490 - ],
491 - ]
492 - );
503 + ],
504 + 'default' => [
505 + 'unit' => 's',
506 + 'size' => 0.2,
507 + ],
508 + 'selectors' => [
509 + '{{WRAPPER}} .ui-e-wrap' => '--ui-e-transition: {{SIZE}}{{UNIT}}',
510 + ],
511 + ]
512 + );
493 513
494 514 $this->end_controls_tab();
495 515
496 516 $this->end_controls_tabs();
@@ -495,13 +515,13 @@
495 515
496 516 $this->end_controls_tabs();
497 517
498 518 $this->add_control(
499 - 'hr',
500 - [
501 - 'type' => \Elementor\Controls_Manager::DIVIDER,
502 - ]
503 - );
519 + 'hr',
520 + [
521 + 'type' => \Elementor\Controls_Manager::DIVIDER,
522 + ]
523 + );
504 524
505 525 $this->add_responsive_control(
506 526 'list_item_border_radius',
507 527 [
@@ -628,20 +648,54 @@
628 648 ],
629 649 ]
630 650 );
631 651
632 - $this->add_responsive_control(
633 - 'icon_number_padding',
652 + $this->add_control(
653 + 'icon_number_width',
634 654 [
635 - 'label' => esc_html__('Padding', 'uicore-elements'),
636 - 'type' => Controls_Manager::DIMENSIONS,
637 - 'size_units' => ['px', 'em', '%'],
638 - 'selectors' => [
639 - '{{WRAPPER}} .ui-e-number' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
655 + 'label' => esc_html__('Width', 'uicore-elements'),
656 + 'type' => Controls_Manager::SLIDER,
657 + 'size_units' => ['px', 'em', 'rem', 'custom'],
658 + 'range' => [
659 + 'px' => [
660 + 'min' => 0,
661 + 'max' => 200,
662 + 'step' => 1,
663 + ],
640 664 ],
665 + 'default' => [
666 + 'unit' => 'px',
667 + 'size' => 25,
668 + ],
669 + 'selectors' => [
670 + '{{WRAPPER}} .ui-e-number' => 'min-width: {{SIZE}}{{UNIT}};',
671 + ],
641 672 ]
642 673 );
643 674
675 + $this->add_control(
676 + 'icon_number_height',
677 + [
678 + 'label' => esc_html__('Height', 'uicore-elements'),
679 + 'type' => Controls_Manager::SLIDER,
680 + 'size_units' => ['px', 'em', 'rem', 'custom'],
681 + 'range' => [
682 + 'px' => [
683 + 'min' => 0,
684 + 'max' => 200,
685 + 'step' => 1,
686 + ],
687 + ],
688 + 'default' => [
689 + 'unit' => 'px',
690 + 'size' => 25,
691 + ],
692 + 'selectors' => [
693 + '{{WRAPPER}} .ui-e-number' => 'min-height: {{SIZE}}{{UNIT}};',
694 + ],
695 + ]
696 + );
697 +
644 698 $this->add_responsive_control(
645 699 'icon_number_margin',
646 700 [
647 701 'label' => esc_html__('Margin', 'uicore-elements'),
@@ -862,30 +916,30 @@
862 916 'tab' => Controls_Manager::TAB_STYLE,
863 917 ]
864 918 );
865 919
866 - $this->add_control(
867 - 'icon_size',
868 - [
869 - 'label' => esc_html__( 'Icon Size', 'uicore-elements' ),
870 - 'type' => \Elementor\Controls_Manager::SLIDER,
871 - 'size_units' => [ 'px'],
872 - 'range' => [
873 - 'px' => [
874 - 'min' => 0,
875 - 'max' => 80,
876 - 'step' => 3,
877 - ],
878 - ],
879 - 'default' => [
880 - 'unit' => 'px',
881 - 'size' => 15,
882 - ],
883 - 'selectors' => [
884 - '{{WRAPPER}} .ui-e-icon' => '--ui-e-icon-size: {{SIZE}}{{UNIT}};',
885 - ],
886 - ]
887 - );
920 + $this->add_responsive_control(
921 + 'icon_size',
922 + [
923 + 'label' => esc_html__('Icon Size', 'uicore-elements'),
924 + 'type' => \Elementor\Controls_Manager::SLIDER,
925 + 'size_units' => ['px'],
926 + 'range' => [
927 + 'px' => [
928 + 'min' => 0,
929 + 'max' => 80,
930 + 'step' => 3,
931 + ],
932 + ],
933 + 'default' => [
934 + 'unit' => 'px',
935 + 'size' => 15,
936 + ],
937 + 'selectors' => [
938 + '{{WRAPPER}} .ui-e-icon' => '--ui-e-icon-size: {{SIZE}}{{UNIT}};',
939 + ],
940 + ]
941 + );
888 942
889 943 $this->start_controls_tabs('tabs_mode_style1');
890 944 $this->start_controls_tab(
891 945 'tab_normal_mode_normal1',
@@ -898,11 +952,10 @@
898 952 'icon_color',
899 953 [
900 954 'label' => esc_html__('Color', 'uicore-elements'),
901 955 'type' => Controls_Manager::COLOR,
902 - 'global' => [
903 - 'default' => Global_Colors::COLOR_PRIMARY,
904 - ],
956 + 'default' => 'var(--e-global-color-uicore_primary)',
957 +
905 958 'selectors' => [
906 959 '{{WRAPPER}} .ui-e-icon' => '--ui-e-icon-color: {{VALUE}}',
907 960 ],
908 961 ]
@@ -1032,90 +1085,88 @@
1032 1085 ]
1033 1086 );
1034 1087
1035 1088 $this->add_control(
1036 - 'line_color',
1037 - [
1038 - 'label' => esc_html__( 'Line Color', 'uicore-elements' ),
1039 - 'type' => \Elementor\Controls_Manager::COLOR,
1040 - 'default' => '#333',
1041 - 'global' => [
1042 - 'default' => Global_Colors::COLOR_PRIMARY,
1043 - ],
1044 - 'selectors' => [
1045 - '{{WRAPPER}} li:after' => 'background-color: {{VALUE}}',
1046 - ],
1047 - ]
1048 - );
1089 + 'line_color',
1090 + [
1091 + 'label' => esc_html__('Line Color', 'uicore-elements'),
1092 + 'type' => \Elementor\Controls_Manager::COLOR,
1093 + 'default' => 'var(--e-global-color-uicore_body)',
1049 1094
1095 + 'selectors' => [
1096 + '{{WRAPPER}} li:after' => 'background-color: {{VALUE}}',
1097 + ],
1098 + ]
1099 + );
1100 +
1050 1101 $this->add_responsive_control(
1051 - 'line_thick',
1052 - [
1053 - 'label' => esc_html__( 'Line Thickness', 'uicore-elements' ),
1054 - 'type' => \Elementor\Controls_Manager::SLIDER,
1055 - 'size_units' => [ 'px'],
1056 - 'range' => [
1057 - 'px' => [
1058 - 'min' => 1,
1059 - 'max' => 10,
1060 - 'step' => 1,
1061 - ],
1062 - ],
1063 - 'default' => [
1064 - 'unit' => 'px',
1065 - 'size' => 1,
1066 - ],
1067 - 'selectors' => [
1068 - '{{WRAPPER}} li:after' => 'width: {{SIZE}}{{UNIT}};',
1069 - ],
1070 - ]
1071 - );
1102 + 'line_thick',
1103 + [
1104 + 'label' => esc_html__('Line Thickness', 'uicore-elements'),
1105 + 'type' => \Elementor\Controls_Manager::SLIDER,
1106 + 'size_units' => ['px'],
1107 + 'range' => [
1108 + 'px' => [
1109 + 'min' => 1,
1110 + 'max' => 10,
1111 + 'step' => 1,
1112 + ],
1113 + ],
1114 + 'default' => [
1115 + 'unit' => 'px',
1116 + 'size' => 1,
1117 + ],
1118 + 'selectors' => [
1119 + '{{WRAPPER}} li:after' => 'width: {{SIZE}}{{UNIT}};',
1120 + ],
1121 + ]
1122 + );
1072 1123
1073 1124 $this->add_responsive_control(
1074 - 'line_horizontal_offset',
1075 - [
1076 - 'label' => esc_html__( 'Line Horizontal Offset', 'uicore-elements' ),
1077 - 'type' => \Elementor\Controls_Manager::SLIDER,
1078 - 'size_units' => [ 'px'],
1079 - 'range' => [
1080 - 'px' => [
1081 - 'min' => 0,
1082 - 'max' => 50,
1083 - 'step' => 1,
1084 - ],
1085 - ],
1086 - 'default' => [
1087 - 'unit' => 'px',
1088 - 'size' => 5,
1089 - ],
1090 - 'selectors' => [
1091 - '{{WRAPPER}} li:after' => '{{icon_position.VALUE}}: {{SIZE}}{{UNIT}};',
1092 - ],
1093 - ]
1094 - );
1125 + 'line_horizontal_offset',
1126 + [
1127 + 'label' => esc_html__('Line Horizontal Offset', 'uicore-elements'),
1128 + 'type' => \Elementor\Controls_Manager::SLIDER,
1129 + 'size_units' => ['px'],
1130 + 'range' => [
1131 + 'px' => [
1132 + 'min' => 0,
1133 + 'max' => 50,
1134 + 'step' => 1,
1135 + ],
1136 + ],
1137 + 'default' => [
1138 + 'unit' => 'px',
1139 + 'size' => 5,
1140 + ],
1141 + 'selectors' => [
1142 + '{{WRAPPER}} li:after' => '{{icon_position.VALUE}}: {{SIZE}}{{UNIT}};',
1143 + ],
1144 + ]
1145 + );
1095 1146
1096 1147 $this->add_responsive_control(
1097 - 'line_vertical_offset',
1098 - [
1099 - 'label' => esc_html__( 'Line Vertical Offset', 'uicore-elements' ),
1100 - 'type' => \Elementor\Controls_Manager::SLIDER,
1101 - 'size_units' => [ 'px'],
1102 - 'range' => [
1103 - 'px' => [
1104 - 'min' => 0,
1105 - 'max' => 100,
1106 - 'step' => 1,
1107 - ],
1108 - ],
1109 - 'default' => [
1110 - 'unit' => 'px',
1111 - 'size' => 15,
1112 - ],
1113 - 'selectors' => [
1114 - '{{WRAPPER}} li:after' => 'top: {{SIZE}}{{UNIT}};',
1115 - ],
1116 - ]
1117 - );
1148 + 'line_vertical_offset',
1149 + [
1150 + 'label' => esc_html__('Line Vertical Offset', 'uicore-elements'),
1151 + 'type' => \Elementor\Controls_Manager::SLIDER,
1152 + 'size_units' => ['px'],
1153 + 'range' => [
1154 + 'px' => [
1155 + 'min' => 0,
1156 + 'max' => 100,
1157 + 'step' => 1,
1158 + ],
1159 + ],
1160 + 'default' => [
1161 + 'unit' => 'px',
1162 + 'size' => 15,
1163 + ],
1164 + 'selectors' => [
1165 + '{{WRAPPER}} li:after' => 'top: {{SIZE}}{{UNIT}};',
1166 + ],
1167 + ]
1168 + );
1118 1169
1119 1170 $this->end_controls_section();
1120 1171
1121 1172 $this->start_controls_section(
@@ -1146,8 +1197,19 @@
1146 1197 ],
1147 1198 ]
1148 1199 );
1149 1200
1201 + $this->add_control(
1202 + 'image_background',
1203 + [
1204 + 'label' => esc_html__('Background Color', 'uicore-elements'),
1205 + 'type' => Controls_Manager::COLOR,
1206 + 'selectors' => [
1207 + '{{WRAPPER}} .ui-e-img img' => 'background-color: {{VALUE}};',
1208 + ],
1209 + ]
1210 + );
1211 +
1150 1212 $this->add_responsive_control(
1151 1213 'image_margin',
1152 1214 [
1153 1215 'label' => esc_html__('Margin', 'uicore-elements'),
@@ -1158,9 +1220,8 @@
1158 1220 ],
1159 1221 ]
1160 1222 );
1161 1223
1162 - //size
1163 1224 $this->add_responsive_control(
1164 1225 'image_size',
1165 1226 [
1166 1227 'label' => esc_html__('Size', 'uicore-elements'),
@@ -1186,105 +1247,82 @@
1186 1247 protected function render()
1187 1248 {
1188 1249
1189 1250 $settings = $this->get_settings_for_display();
1251 + $this->add_render_attribute('icon_list', 'class', $this->is_option('show_number_icon', 'yes') ? 'ui-e-number' : '');
1252 +?>
1253 + <ul>
1254 + <?php foreach ($settings['icon_list'] as $index => $item) :
1190 1255
1191 - $ulClass = '';
1256 + $i = $index + 1; // index is 0 based
1192 1257
1193 - if($settings['show_number_icon']){
1194 - $ulClass .= ' ui-e-number';
1195 - }
1258 + // Prepare the atts
1259 + $repeater_setting_key = $this->get_repeater_setting_key('text', 'icon_list', $index);
1260 + $tag = $settings['title_tags'];
1261 + $this->add_render_attribute($repeater_setting_key, 'class', 'elementor-icon-list-text');
1262 + $this->add_render_attribute('list_title_tags', 'class', 'ui-e-title', true);
1196 1263
1197 - // Create atts
1198 - $this->add_render_attribute('icon_list', 'class', esc_attr($ulClass));
1199 - $this->add_render_attribute('list_item', 'class', 'elementor-icon-list-item');
1264 + // Build url wrapper if link is set
1265 + if (!empty($item['link']['url'])) {
1266 + $link_key = 'link_' . $index;
1267 + $this->add_link_attributes($link_key, $item['link']);
1200 1268
1201 - ?>
1202 - <ul>
1269 + $wrapper = "<a class='ui-e-wrap' {$this->get_render_attribute_string($link_key)}>";
1270 + $wrapperClosure = 'a';
1203 1271
1204 - <?php
1205 - $i = 1; // counter
1206 - foreach ($settings['icon_list'] as $index => $item) : // starts the iteration
1272 + // Build default wrapper otherwise
1273 + } else {
1274 + $wrapper = '<div class="ui-e-wrap">';
1275 + $wrapperClosure = 'div';
1276 + }
1207 1277
1208 - // Render some basic atts
1209 - $repeater_setting_key = $this->get_repeater_setting_key('text', 'icon_list', $index);
1210 - $this->add_render_attribute($repeater_setting_key, 'class', 'elementor-icon-list-text');
1211 - $this->add_inline_editing_attributes($repeater_setting_key);
1278 + ?>
1279 + <li <?php $this->print_render_attribute_string('list_class'); ?>>
1212 1280
1213 - // Render content atts and data
1214 - $this->add_render_attribute('list_title_tags', 'class', 'ui-e-title', true);
1215 - $tag = $settings['title_tags'];
1281 + <?php echo wp_kses_post($wrapper); ?>
1216 1282
1217 - // Check if current item has link
1218 - if (!empty( $item['link']['url'] ) ) {
1219 - $link_key = 'link_' . $index; // creates an unique link key via index
1220 - $this->add_link_attributes( $link_key, $item['link'] ); // render links atts
1283 + <?php if ($this->is_option('show_number_icon', 'yes')) : ?>
1284 + <div class='ui-e-number'>
1285 + <span> <?php echo esc_html($i); ?> </span>
1286 + </div>
1287 + <?php endif; ?>
1221 1288
1222 - $wrapper = "<a class='ui-e-wrap' {$this->get_render_attribute_string($link_key)}>"; // creates the html
1223 - $wrapperClosure = 'a';
1224 - } else {
1225 - $wrapper = '<div class="ui-e-wrap">'; // if it hasn't, creates basic div wrapper
1226 - $wrapperClosure = 'div';
1227 - }
1228 -
1229 - // Check if the current item XXX
1230 - if ($i > intval($settings['columns'])) {
1231 - $this->add_render_attribute('list_class', 'class', 'ui-e-spacing', true);
1232 - }
1233 - ?>
1234 - <li <?php $this->print_render_attribute_string('list_class');?>>
1235 - <?php echo wp_kses_post($wrapper);?>
1236 -
1289 + <?php if (!empty($item['img']['url'])) : ?>
1290 + <div class="ui-e-img">
1237 1291 <?php
1238 - //Number
1239 - if($settings['show_number_icon'] == 'yes') :
1292 + $thumb_url = $item['img']['url'];
1293 + if ($thumb_url) {
1294 + echo wp_kses_post(wp_get_attachment_image(
1295 + $item['img']['id'],
1296 + 'medium',
1297 + false,
1298 + [
1299 + 'alt' => esc_html($item['text'])
1300 + ]
1301 + ));
1302 + }
1240 1303 ?>
1241 - <div class='ui-e-number'><span><?php esc_html($i);?></span></div>
1242 - <?php
1243 - $i++;
1244 - endif;
1245 - ?>
1304 + </div>
1305 + <?php endif; ?>
1246 1306
1247 - <?php
1248 - // Image
1249 - if (!empty($item['img']['url'])) : ?>
1250 - <div class="ui-e-img">
1251 - <?php
1252 - $thumb_url = $item['img']['url'];
1253 - if ($thumb_url) {
1254 - echo wp_kses_post(wp_get_attachment_image(
1255 - $item['img']['id'],
1256 - 'medium',
1257 - false,
1258 - [
1259 - 'alt' => esc_html($item['text'])
1260 - ]
1261 - ));
1262 - }
1263 - ?>
1264 - </div>
1265 - <?php endif; ?>
1307 + <div class="ui-e-content">
1308 + <<?php echo Helper::esc_tag($tag); ?> <?php $this->print_render_attribute_string('list_title_tags'); ?>>
1309 + <?php echo wp_kses_post($item['text']); ?>
1310 + </<?php echo Helper::esc_tag($tag); ?>>
1311 + <p class="ui-e-text"> <?php echo wp_kses_post($item['text_details']); ?> </p>
1312 + </div>
1266 1313
1267 - <div class="ui-e-content">
1268 - <<?php echo esc_html($tag);?> <?php $this->print_render_attribute_string('list_title_tags');?>>
1269 - <?php echo wp_kses_post($item['text']); ?>
1270 - </<?php echo esc_html($tag);?>>
1271 - <p class="ui-e-text"> <?php echo wp_kses_post($item['text_details']);?> </p>
1272 - </div>
1314 + <?php if (!empty($item['list_icon']['value'])) : ?>
1315 + <div class="ui-e-icon">
1316 + <?php Icons_Manager::render_icon($item['list_icon'], ['aria-hidden' => 'true']); ?>
1317 + </div>
1318 + <?php endif; ?>
1273 1319
1274 - <?php
1275 - // Icon element
1276 - if (!empty($item['list_icon']['value'])) : ?>
1277 - <div class="ui-e-icon">
1278 - <?php Icons_Manager::render_icon($item['list_icon'], ['aria-hidden' => 'true']); ?>
1279 - </div>
1280 - <?php endif; ?>
1281 -
1282 - </<?php echo esc_html($wrapperClosure)?>>
1283 - </li>
1284 - <?php $i++;
1320 + </<?php echo esc_html($wrapperClosure) ?>>
1321 + </li>
1322 + <?php
1285 1323 endforeach; ?>
1286 - </ul>
1287 - <?php
1324 + </ul>
1325 +<?php
1288 1326 }
1289 1327 }
1290 -\Elementor\Plugin::instance()->widgets_manager->register(new IconList());
1328 +\Elementor\Plugin::instance()->widgets_manager->register(new IconList());