PluginProbe
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder / 51.1.49
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder v51.1.49
51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 51.1.47 51.1.49 All 37 releases
king-addons / includes / widgets / Feature_List / Feature_List.php

Feature_List.php in King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder 51.1.49, at includes/widgets/Feature_List/Feature_List.php

943 lines 35.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php /** @noinspection PhpUnused */
2
3 namespace King_Addons;
4
5 use Elementor\Icons_Manager;
6 use Elementor\Repeater;
7 use Elementor\Widget_Base;
8 use Elementor\Controls_Manager;
9 use Elementor\Group_Control_Typography;
10 use Elementor\Group_Control_Image_Size;
11
12 if (!defined('ABSPATH')) {
13 exit; // Exit if accessed directly.
14 }
15
16
17
18 class Feature_List extends Widget_Base
19 {
20
21
22
23 public function get_name(): string
24 {
25 return 'king-addons-feature-list';
26 }
27
28 public function get_title(): string
29 {
30 return esc_html__('Feature List', 'king-addons');
31 }
32
33 public function get_icon(): string
34 {
35 return 'king-addons-icon king-addons-feature-list';
36 }
37
38 public function get_script_depends(): array
39 {
40 return [KING_ADDONS_ASSETS_UNIQUE_KEY . '-feature-list-script'];
41 }
42
43 public function get_style_depends(): array
44 {
45 return [KING_ADDONS_ASSETS_UNIQUE_KEY . '-feature-list-style'];
46 }
47
48 public function get_categories(): array
49 {
50 return ['king-addons'];
51 }
52
53 public function get_keywords(): array
54 {
55 return ['rows', 'kingaddons', 'king-addons', 'king', 'addons', 'schedule', 'service', 'services', 'list',
56 'title', 'titles', 'description', 'row', 'column', 'prices', 'columns', 'subtitles', 'menu', 'sub', 'order',
57 'sorting', 'rate', 'sheet', 'catalog', 'guide', 'sort', 'schedule', 'feature', 'features', 'options',
58 'option', 'fare', 'meal', 'selection', 'board', 'review', 'icon', 'icons', 'feature list', 'icon list',
59 'features list', 'icons list', 'headings', 'text'
60 ];
61 }
62
63 public function get_custom_help_url()
64 {
65 return 'mailto:bug@kingaddons.com?subject=Bug Report - King Addons&body=Please describe the issue';
66 }
67
68 protected function register_controls()
69 {
70 $this->start_controls_section(
71 'king_addons_section_feature_list_general',
72 [
73 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('General', 'king-addons'),
74 'tab' => Controls_Manager::TAB_CONTENT,
75 ]
76 );
77
78 $this->add_responsive_control(
79 'king_addons_feature_list_layout',
80 [
81 'label' => esc_html__('Layout', 'king-addons'),
82 'type' => Controls_Manager::CHOOSE,
83 'label_block' => false,
84 'default' => 'left',
85 'options' => [
86 'left' => [
87 'title' => esc_html__('Left', 'king-addons'),
88 'icon' => 'eicon-h-align-left',
89 ],
90 'center' => [
91 'title' => esc_html__('Center', 'king-addons'),
92 'icon' => 'eicon-h-align-center',
93 ],
94 'right' => [
95 'title' => esc_html__('Right', 'king-addons'),
96 'icon' => 'eicon-h-align-right',
97 ]
98 ],
99 'prefix_class' => 'king-addons-feature-list-',
100 'render_type' => 'template',
101 'selectors' => [
102 '{{WRAPPER}} .king-addons-feature-list-item' => 'justify-content: {{VALUE}}',
103 ],
104 'separator' => 'before',
105 ]
106 );
107
108 $this->add_control(
109 'king_addons_feature_list_icon_vertical_align',
110 [
111 'label' => esc_html__('Vertical Align', 'king-addons'),
112 'type' => Controls_Manager::CHOOSE,
113 'label_block' => false,
114 'default' => 'center',
115 'options' => [
116 'flex-start' => [
117 'title' => esc_html__('Top', 'king-addons'),
118 'icon' => 'eicon-v-align-top',
119 ],
120 'center' => [
121 'title' => esc_html__('Middle', 'king-addons'),
122 'icon' => 'eicon-v-align-middle',
123 ],
124 'flex-end' => [
125 'title' => esc_html__('Bottom', 'king-addons'),
126 'icon' => 'eicon-v-align-bottom',
127 ]
128 ],
129 'render_type' => 'template',
130 'selectors' => [
131 '{{WRAPPER}}.king-addons-feature-list-left .king-addons-feature-list-item' => 'align-items: {{VALUE}}',
132 '{{WRAPPER}}.king-addons-feature-list-right .king-addons-feature-list-item' => 'align-items: {{VALUE}}'
133 ],
134 'condition' => [
135 'king_addons_feature_list_layout!' => 'center',
136 ]
137 ]
138 );
139
140 $this->add_control(
141 'king_addons_feature_list_content_alignment',
142 [
143 'label' => esc_html__('Alignment', 'king-addons'),
144 'type' => Controls_Manager::CHOOSE,
145 'options' => [
146 'flex-start' => [
147 'title' => esc_html__('Left', 'king-addons'),
148 'icon' => 'eicon-text-align-left',
149 ],
150 'center' => [
151 'title' => esc_html__('Center', 'king-addons'),
152 'icon' => 'eicon-text-align-center',
153 ],
154 'flex-end' => [
155 'title' => esc_html__('Right', 'king-addons'),
156 'icon' => 'eicon-text-align-right',
157 ]
158 ],
159 'prefix_class' => 'king-addons-feature-list-align-',
160 'render_type' => 'template',
161 'default' => 'center',
162 'selectors' => [
163 '{{WRAPPER}} .king-addons-feature-list-item' => 'align-items: {{VALUE}};',
164 ],
165 'condition' => [
166 'king_addons_feature_list_layout' => 'center',
167 ]
168 ]
169 );
170
171 $this->add_control(
172 'king_addons_feature_list_icon_shape',
173 [
174 'label' => esc_html__('Icon Shape', 'king-addons'),
175 'type' => Controls_Manager::SELECT,
176 'default' => 'square',
177 'label_block' => false,
178 'options' => [
179 'square' => esc_html__('Square', 'king-addons'),
180 'rhombus' => esc_html__('Rhombus', 'king-addons')
181 ],
182 'separator' => 'before',
183 'prefix_class' => 'king-addons-feature-list-'
184 ]
185 );
186
187 $this->add_group_control(
188 Group_Control_Image_Size::get_type(),
189 [
190 'name' => 'king_addons_feature_list_thumbnail',
191 'exclude' => ['custom'],
192 'include' => [],
193 'default' => 'large',
194 ]
195 );
196
197 $this->add_control(
198 'king_addons_feature_list_title_tag',
199 [
200 'label' => esc_html__('Title HTML Tag', 'king-addons'),
201 'type' => Controls_Manager::SELECT,
202 'options' => [
203 'h1' => 'H1',
204 'h2' => 'H2',
205 'h3' => 'H3',
206 'h4' => 'H4',
207 'h5' => 'H5',
208 'h6' => 'H6',
209 'div' => 'div',
210 'span' => 'span',
211 'P' => 'p'
212 ],
213 'default' => 'h2'
214 ]
215 );
216
217 $this->add_control(
218 'king_addons_feature_list_line',
219 [
220 'label' => esc_html__('Show Line', 'king-addons'),
221 'type' => Controls_Manager::SWITCHER,
222 'render_type' => 'template',
223 'prefix_class' => 'king-addons-feature-list-line-',
224 'separator' => 'before',
225 'default' => 'yes',
226 'condition' => [
227 'king_addons_feature_list_layout' => ['left', 'right']
228 ]
229 ]
230 );
231
232 $this->add_responsive_control(
233 'king_addons_feature_list_item_spacing_v',
234 [
235 'label' => esc_html__('Vertical Spacing', 'king-addons'),
236 'type' => Controls_Manager::SLIDER,
237 'size_units' => ['px'],
238 'range' => [
239 'px' => [
240 'min' => 0,
241 'max' => 100,
242 ],
243 ],
244 'default' => [
245 'unit' => 'px',
246 'size' => 35,
247 ],
248 'selectors' => [
249 '{{WRAPPER}} .king-addons-feature-list-item:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}};',
250 ],
251 'separator' => 'before'
252 ]
253 );
254
255 $this->add_responsive_control(
256 'king_addons_feature_list_item_spacing_h',
257 [
258 'label' => esc_html__('Horizontal Spacing', 'king-addons'),
259 'type' => Controls_Manager::SLIDER,
260 'size_units' => ['px'],
261 'range' => [
262 'px' => [
263 'min' => 0,
264 'max' => 100,
265 ],
266 ],
267 'default' => [
268 'unit' => 'px',
269 'size' => 20,
270 ],
271 'selectors' => [
272 '{{WRAPPER}}.king-addons-feature-list-left .king-addons-feature-list-icon-wrap' => 'margin-right: {{SIZE}}{{UNIT}};',
273 '{{WRAPPER}}.king-addons-feature-list-right .king-addons-feature-list-icon-wrap' => 'margin-left: {{SIZE}}{{UNIT}};',
274 ],
275 'condition' => [
276 'king_addons_feature_list_layout!' => 'center'
277 ]
278 ]
279 );
280
281 $this->add_responsive_control(
282 'king_addons_feature_list_item_title_distance',
283 [
284 'label' => esc_html__('Title Distance', 'king-addons'),
285 'type' => Controls_Manager::SLIDER,
286 'size_units' => ['px'],
287 'range' => [
288 'px' => [
289 'min' => 0,
290 'max' => 100,
291 ],
292 ],
293 'default' => [
294 'unit' => 'px',
295 'size' => 5,
296 ],
297 'selectors' => [
298 '{{WRAPPER}} .king-addons-feature-list-title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
299 ],
300 ]
301 );
302
303 $this->add_control(
304 'king_addons_feature_list_item_media_distance',
305 [
306 'label' => esc_html__('Media Distance', 'king-addons'),
307 'type' => Controls_Manager::SLIDER,
308 'size_units' => ['px'],
309 'range' => [
310 'px' => [
311 'min' => 0,
312 'max' => 100,
313 ],
314 ],
315 'default' => [
316 'unit' => 'px',
317 'size' => 0,
318 ],
319 'selectors' => [
320 '{{WRAPPER}} .king-addons-feature-list-icon-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};',
321 ],
322 'condition' => [
323 'king_addons_feature_list_layout' => 'center'
324 ]
325 ]
326 );
327
328 $this->end_controls_section();
329
330 $this->start_controls_section(
331 'king_addons_feature_list_content_section',
332 [
333 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Content', 'king-addons'),
334 'tab' => Controls_Manager::TAB_CONTENT,
335 ]
336 );
337
338 $repeater = new Repeater();
339
340 $repeater->start_controls_tabs(
341 'king_addons_feature_list_tabs'
342 );
343
344 $repeater->start_controls_tab(
345 'king_addons_feature_list_content_tab',
346 [
347 'label' => esc_html__('Content', 'king-addons'),
348 ]
349 );
350
351 $repeater->add_control(
352 'king_addons_feature_list_media_type',
353 [
354 'label' => esc_html__('Media Type', 'king-addons'),
355 'type' => Controls_Manager::SELECT,
356 'options' => [
357 'icon' => esc_html__('Icon', 'king-addons'),
358 'image' => esc_html__('Image', 'king-addons')
359 ],
360 'default' => 'icon',
361 'label_block' => false,
362 ]
363 );
364
365 $repeater->add_control(
366 'king_addons_feature_list_icon',
367 [
368 'label' => esc_html__('Select Icon', 'king-addons'),
369 'type' => Controls_Manager::ICONS,
370 'default' => [
371 'value' => 'fas fa-star',
372 'library' => 'solid',
373 ],
374 'label_block' => false,
375 'skin' => 'inline',
376 'condition' => [
377 'king_addons_feature_list_media_type' => 'icon'
378 ]
379 ]
380 );
381
382 $repeater->add_control(
383 'king_addons_feature_list_image',
384 [
385 'label' => esc_html__('Choose Image', 'king-addons'),
386 'type' => Controls_Manager::MEDIA,
387 'skin' => 'inline',
388 'dynamic' => [
389 'active' => true,
390 ],
391 'condition' => [
392 'king_addons_feature_list_media_type' => 'image'
393 ]
394 ]
395 );
396
397 $repeater->add_control(
398 'king_addons_feature_list_list_title', [
399 'label' => esc_html__('Title', 'king-addons'),
400 'type' => Controls_Manager::TEXT,
401 'dynamic' => [
402 'active' => true,
403 ],
404 'default' => esc_html__('Title', 'king-addons'),
405 'separator' => 'before',
406 'label_block' => true,
407 ]
408 );
409
410 $repeater->add_control(
411 'king_addons_feature_list_list_title_url',
412 [
413 'label' => esc_html__('Title Link', 'king-addons'),
414 'type' => Controls_Manager::URL,
415 'dynamic' => [
416 'active' => true,
417 ],
418 'placeholder' => esc_html__('https://example.com', 'king-addons'),
419 'default' => [
420 'url' => '',
421 'is_external' => true,
422 'nofollow' => true,
423 'custom_attributes' => '',
424 ],
425 'label_block' => true,
426 ]
427 );
428
429 $repeater->add_control(
430 'king_addons_feature_list_description',
431 [
432 'label' => esc_html__('Description', 'king-addons'),
433 'type' => Controls_Manager::TEXTAREA,
434 'dynamic' => [
435 'active' => true,
436 ],
437 'default' => esc_html__('Description', 'king-addons'),
438 'placeholder' => esc_html__('Type the description here', 'king-addons'),
439 'rows' => 10,
440 ]
441 );
442
443 $repeater->end_controls_tab();
444
445 $repeater->start_controls_tab(
446 'king_addons_feature_list_styles_tab',
447 [
448 'label' => esc_html__('Style', 'king-addons'),
449 ]
450 );
451
452 $repeater->add_control(
453 'king_addons_feature_list_custom_styles',
454 [
455 'label' => esc_html__('Custom Styles', 'king-addons'),
456 'type' => Controls_Manager::SWITCHER,
457 ]
458 );
459
460 $repeater->add_control(
461 'king_addons_feature_list_title_color_unique',
462 [
463 'label' => esc_html__('Title Color', 'king-addons'),
464 'type' => Controls_Manager::COLOR,
465 'selectors' => [
466 '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-feature-list-title a.king-addons-feature-list-url' => 'color: {{VALUE}}',
467 '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-feature-list-title' => 'color: {{VALUE}}'
468 ],
469 'condition' => [
470 'king_addons_feature_list_custom_styles' => 'yes'
471 ]
472 ]
473 );
474
475 $repeater->add_control(
476 'king_addons_feature_list_icon_color_unique',
477 [
478 'label' => esc_html__('Icon Color', 'king-addons'),
479 'type' => Controls_Manager::COLOR,
480 'default' => '#ffffff',
481 'selectors' => [
482 '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-feature-list-icon-inner-wrap i' => 'color: {{VALUE}}',
483 '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-feature-list-icon-inner-wrap svg' => 'fill: {{VALUE}}',
484 ],
485 'condition' => [
486 'king_addons_feature_list_custom_styles' => 'yes'
487 ]
488 ]
489 );
490
491 $repeater->add_control(
492 'king_addons_feature_list_icon_wrapper_bg_color_unique',
493 [
494 'label' => esc_html__('Icon Bg Color', 'king-addons'),
495 'type' => Controls_Manager::COLOR,
496 'default' => '#9B62FF',
497 'selectors' => [
498 '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-feature-list-icon-inner-wrap' => 'background-color: {{VALUE}}',
499 ],
500 'condition' => [
501 'king_addons_feature_list_custom_styles' => 'yes'
502 ]
503 ]
504 );
505
506 $repeater->add_control(
507 'king_addons_feature_list_icon_wrapper_border_color_unique',
508 [
509 'label' => esc_html__('Icon Border Color', 'king-addons'),
510 'type' => Controls_Manager::COLOR,
511 'default' => '#5B03FF',
512 'selectors' => [
513 '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-feature-list-icon-inner-wrap' => 'border-color: {{VALUE}}',
514 ],
515 'condition' => [
516 'king_addons_feature_list_custom_styles' => 'yes'
517 ]
518 ]
519 );
520
521 $repeater->end_controls_tab();
522
523 $repeater->end_controls_tabs();
524
525 $this->add_control(
526 'king_addons_feature_repeater_list',
527 [
528 'label' => esc_html__('Repeater List', 'king-addons'),
529 'type' => Controls_Manager::REPEATER,
530 'fields' => $repeater->get_controls(),
531 'default' => [
532 [
533 'king_addons_feature_list_list_title' => esc_html__('Easy Integration', 'king-addons'),
534 'king_addons_feature_list_description' => esc_html__('Seamlessly integrate with various tools and platforms, enhancing functionality without complexity.', 'king-addons'),
535 'king_addons_feature_list_icon' => [
536 'value' => 'fas fa-plug',
537 'library' => 'solid'
538 ],
539 ],
540 [
541 'king_addons_feature_list_list_title' => esc_html__('Versatile Layout Options', 'king-addons'),
542 'king_addons_feature_list_description' => esc_html__('Choose from a variety of layout designs and icon shapes to suit your unique style.', 'king-addons'),
543 'king_addons_feature_list_icon' => [
544 'value' => 'fas fa-th-large',
545 'library' => 'solid'
546 ],
547 'king_addons_feature_list_custom_styles' => 'yes',
548 'king_addons_feature_list_icon_wrapper_bg_color_unique' => '#4CAF50'
549 ],
550 [
551 'king_addons_feature_list_list_title' => esc_html__('Custom Colors & Styles', 'king-addons'),
552 'king_addons_feature_list_description' => esc_html__('Easily apply custom colors, fonts, and backgrounds to make each feature align with your brand.', 'king-addons'),
553 'king_addons_feature_list_icon' => [
554 'value' => 'fas fa-palette',
555 'library' => 'solid'
556 ],
557 ],
558 [
559 'king_addons_feature_list_list_title' => esc_html__('Interactive Animations', 'king-addons'),
560 'king_addons_feature_list_description' => esc_html__('Add engaging animations that activate on hover to keep users engaged and improve interactivity.', 'king-addons'),
561 'king_addons_feature_list_icon' => [
562 'value' => 'fas fa-magic',
563 'library' => 'solid'
564 ],
565 ],
566 ],
567 'title_field' => '{{{ king_addons_feature_list_list_title }}}',
568 ]
569 );
570
571 $this->end_controls_section();
572
573 $this->start_controls_section(
574 'king_addons_section_feature_list_icon_styles',
575 [
576 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media', 'king-addons'),
577 'tab' => Controls_Manager::TAB_STYLE,
578 ]
579 );
580
581 $this->add_control(
582 'king_addons_feature_list_icon_color',
583 [
584 'label' => esc_html__('Color', 'king-addons'),
585 'type' => Controls_Manager::COLOR,
586 'default' => '#FFFFFF',
587 'selectors' => [
588 '{{WRAPPER}} .king-addons-feature-list-icon-inner-wrap i' => 'color: {{VALUE}}',
589 '{{WRAPPER}} .king-addons-feature-list-icon-inner-wrap svg' => 'fill: {{VALUE}}',
590 ],
591 ]
592 );
593
594 $this->add_control(
595 'king_addons_feature_list_icon_wrapper_bg_color',
596 [
597 'label' => esc_html__('Background Color', 'king-addons'),
598 'type' => Controls_Manager::COLOR,
599 'default' => '#5B03FF',
600 'selectors' => [
601 '{{WRAPPER}} .king-addons-feature-list-icon-inner-wrap' => 'background-color: {{VALUE}}',
602 ],
603 ]
604 );
605
606 $this->add_control(
607 'king_addons_feature_list_icon_wrapper_border_color',
608 [
609 'label' => esc_html__('Border Color', 'king-addons'),
610 'type' => Controls_Manager::COLOR,
611 'default' => '',
612 'selectors' => [
613 '{{WRAPPER}} .king-addons-feature-list-icon-inner-wrap' => 'border-color: {{VALUE}}',
614 ],
615 ]
616 );
617
618 $this->add_responsive_control(
619 'king_addons_feature_list_icon_size',
620 [
621 'label' => esc_html__('Icon Size', 'king-addons'),
622 'type' => Controls_Manager::SLIDER,
623 'range' => [
624 'px' => [
625 'min' => 5,
626 'max' => 100,
627 ],
628 ],
629 'default' => [
630 'unit' => 'px',
631 'size' => 25,
632 ],
633 'selectors' => [
634 '{{WRAPPER}} .king-addons-feature-list-icon-wrap i' => 'font-size: {{SIZE}}{{UNIT}};',
635 '{{WRAPPER}} .king-addons-feature-list-icon-wrap svg' => 'width: {{SIZE}}{{UNIT}}; height: auto;',
636 ],
637 'separator' => 'before',
638 ]
639 );
640
641 $this->add_responsive_control(
642 'king_addons_feature_list_icon_wrapper_size',
643 [
644 'label' => esc_html__('Box Size', 'king-addons'),
645 'type' => Controls_Manager::SLIDER,
646 'render_type' => 'template',
647 'range' => [
648 'px' => [
649 'min' => 5,
650 'max' => 200,
651 ],
652 ],
653 'default' => [
654 'unit' => 'px',
655 'size' => 75,
656 ],
657 'selectors' => [
658 '{{WRAPPER}} .king-addons-feature-list-icon-inner-wrap' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}'
659 ]
660 ]
661 );
662
663 $this->add_control(
664 'king_addons_feature_list_icon_wrapper_border_type',
665 [
666 'label' => esc_html__('Border Type', 'king-addons'),
667 'type' => Controls_Manager::SELECT,
668 'options' => [
669 'none' => esc_html__('None', 'king-addons'),
670 'solid' => esc_html__('Solid', 'king-addons'),
671 'double' => esc_html__('Double', 'king-addons'),
672 'dotted' => esc_html__('Dotted', 'king-addons'),
673 'dashed' => esc_html__('Dashed', 'king-addons'),
674 'groove' => esc_html__('Groove', 'king-addons'),
675 ],
676 'default' => 'none',
677 'selectors' => [
678 '{{WRAPPER}} .king-addons-feature-list-icon-inner-wrap' => 'border-style: {{VALUE}};',
679 ],
680 'separator' => 'before',
681 ]
682 );
683
684 $this->add_control(
685 'king_addons_feature_list_icon_wrapper_border_width',
686 [
687 'label' => esc_html__('Border Width', 'king-addons'),
688 'type' => Controls_Manager::DIMENSIONS,
689 'size_units' => ['px'],
690 'default' => [
691 'top' => 1,
692 'right' => 1,
693 'bottom' => 1,
694 'left' => 1,
695 ],
696 'selectors' => [
697 '{{WRAPPER}} .king-addons-feature-list-icon-inner-wrap' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
698 ],
699 'condition' => [
700 'king_addons_feature_list_icon_wrapper_border_type!' => 'none',
701 ]
702 ]
703 );
704
705 $this->add_control(
706 'king_addons_feature_list_icon_wrapper_border_radius',
707 [
708 'label' => esc_html__('Border Radius', 'king-addons'),
709 'type' => Controls_Manager::DIMENSIONS,
710 'size_units' => ['px'],
711 'default' => [
712 'top' => 5,
713 'right' => 5,
714 'bottom' => 5,
715 'left' => 5,
716 ],
717 'selectors' => [
718 '{{WRAPPER}} .king-addons-feature-list-icon-inner-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
719 ]
720 ]
721 );
722
723 $this->end_controls_section();
724
725 $this->start_controls_section(
726 'king_addons_section_feature_list_line_styles',
727 [
728 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Line', 'king-addons'),
729 'tab' => Controls_Manager::TAB_STYLE,
730 'condition' => [
731 'king_addons_feature_list_line' => 'yes'
732 ]
733 ]
734 );
735
736 $this->add_control(
737 'king_addons_feature_list_line_color',
738 [
739 'label' => esc_html__('Color', 'king-addons'),
740 'type' => Controls_Manager::COLOR,
741 'default' => '#5B03FF',
742 'selectors' => [
743 '{{WRAPPER}} .king-addons-feature-list-line' => 'border-color: {{VALUE}}'
744 ],
745 ]
746 );
747
748 $this->add_control(
749 'king_addons_feature_list_line_width',
750 [
751 'label' => esc_html__('Width', 'king-addons'),
752 'type' => Controls_Manager::SLIDER,
753 'size_units' => ['px'],
754 'range' => [
755 'px' => [
756 'min' => 1,
757 'max' => 10,
758 ],
759 ],
760 'default' => [
761 'unit' => 'px',
762 'size' => 2,
763 ],
764 'selectors' => [
765 '{{WRAPPER}} .king-addons-feature-list-line' => 'border-left-width: {{SIZE}}{{UNIT}};',
766 ],
767 'separator' => 'before'
768 ]
769 );
770
771 $this->add_control(
772 'king_addons_feature_list_line_border_type',
773 [
774 'label' => esc_html__('Type', 'king-addons'),
775 'type' => Controls_Manager::SELECT,
776 'default' => 'solid',
777 'label_block' => false,
778 'options' => [
779 'solid' => esc_html__('Solid', 'king-addons'),
780 'dashed' => esc_html__('Dashed', 'king-addons'),
781 'dotted' => esc_html__('Dotted', 'king-addons'),
782 ],
783 'selectors' => [
784 '{{WRAPPER}} .king-addons-feature-list-line' => 'border-left-style: {{VALUE}};',
785 ]
786 ]
787 );
788
789 $this->end_controls_section();
790
791 $this->start_controls_section(
792 'king_addons_section_feature_list_title_description_styles',
793 [
794 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Title & Description', 'king-addons'),
795 'tab' => Controls_Manager::TAB_STYLE,
796 ]
797 );
798
799 $this->add_control(
800 'king_addons_feature_list_title_heading',
801 [
802 'label' => esc_html__('Title', 'king-addons'),
803 'type' => Controls_Manager::HEADING,
804 'separator' => 'before'
805 ]
806 );
807
808 $this->add_control(
809 'king_addons_feature_list_title_color',
810 [
811 'label' => esc_html__('Color', 'king-addons'),
812 'type' => Controls_Manager::COLOR,
813 'default' => '#000000',
814 'selectors' => [
815 '{{WRAPPER}} .king-addons-feature-list-title' => 'color: {{VALUE}}',
816 '{{WRAPPER}} .king-addons-feature-list-title a.king-addons-feature-list-url' => 'color: {{VALUE}}',
817 ],
818 ]
819 );
820
821 $this->add_group_control(
822 Group_Control_Typography::get_type(),
823 [
824 'name' => 'king_addons_feature_list_title',
825 'selector' => '{{WRAPPER}} .king-addons-feature-list-title',
826 'fields_options' => [
827 'typography' => [
828 'default' => 'custom',
829 ],
830 'font_weight' => [
831 'default' => '600',
832 ],
833 'font_family' => [
834 'default' => 'Inter',
835 ],
836 'font_size' => [
837 'default' => [
838 'size' => '20',
839 'unit' => 'px',
840 ]
841 ]
842 ]
843 ]
844 );
845
846 $this->add_control(
847 'king_addons_feature_list_description_heading',
848 [
849 'label' => esc_html__('Description', 'king-addons'),
850 'type' => Controls_Manager::HEADING,
851 'separator' => 'before'
852 ]
853 );
854
855 $this->add_control(
856 'king_addons_feature_list_description_color',
857 [
858 'label' => esc_html__('Color', 'king-addons'),
859 'type' => Controls_Manager::COLOR,
860 'default' => '#6e6e73',
861 'selectors' => [
862 '{{WRAPPER}} .king-addons-feature-list-description' => 'color: {{VALUE}}',
863 ],
864 ]
865 );
866
867 $this->add_group_control(
868 Group_Control_Typography::get_type(),
869 [
870 'name' => 'king_addons_feature_list_typography_description',
871 'selector' => '{{WRAPPER}} .king-addons-feature-list-description',
872 'fields_options' => [
873 'typography' => [
874 'default' => 'custom',
875 ],
876 'font_weight' => [
877 'default' => '400',
878 ],
879 'font_family' => [
880 'default' => 'Inter',
881 ],
882 'font_size' => [
883 'default' => [
884 'size' => '14',
885 'unit' => 'px',
886 ]
887 ]
888 ]
889 ]
890 );
891
892
893
894
895 $this->end_controls_section();
896
897
898 }
899
900 protected function render()
901 {
902 $settings = $this->get_settings_for_display();
903
904 if ($settings['king_addons_feature_repeater_list']) {
905 $tags_whitelist = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'span', 'p'];
906 $feature_list_title_tag = in_array($settings['king_addons_feature_list_title_tag'], $tags_whitelist) ? $settings['king_addons_feature_list_title_tag'] : 'h2';
907
908 $count_items = 0;
909
910 echo '<div class="king-addons-feature-list-wrap">';
911 echo '<ul class="king-addons-feature-list">';
912
913 foreach ($settings['king_addons_feature_repeater_list'] as $item) {
914 $this->add_link_attributes('king_addons_feature_list_list_title_url' . $count_items, $item['king_addons_feature_list_list_title_url']);
915 echo '<li class="king-addons-feature-list-item elementor-repeater-item-' . esc_attr($item['_id']) . '">';
916 echo '<div class="king-addons-feature-list-icon-wrap">';
917 echo '<span class="king-addons-feature-list-line"></span>';
918 echo '<div class="king-addons-feature-list-icon-inner-wrap">';
919 if ('icon' === $item['king_addons_feature_list_media_type']) {
920 Icons_Manager::render_icon($item['king_addons_feature_list_icon'], ['aria-hidden' => 'true']);
921 } else {
922 $src = Group_Control_Image_Size::get_attachment_image_src($item['king_addons_feature_list_image']['id'], 'king_addons_feature_list_thumbnail', $settings);
923 echo '<img src="' . esc_url($src) . '">';
924 }
925 echo '</div>';
926 echo '</div>';
927 echo '<div class="king-addons-feature-list-content-wrap">';
928 if (empty($item['king_addons_feature_list_list_title_url'])) {
929 echo '<' . esc_attr($feature_list_title_tag) . ' class="king-addons-feature-list-title">' . wp_kses_post($item['king_addons_feature_list_list_title']) . '</' . esc_attr($feature_list_title_tag) . '>';
930 } else {
931 echo '<' . esc_attr($feature_list_title_tag) . ' class="king-addons-feature-list-title"><a class="king-addons-feature-list-url" ' . $this->get_render_attribute_string('king_addons_feature_list_list_title_url' . $count_items) . '>' . wp_kses_post($item['king_addons_feature_list_list_title']) . '</a></' . esc_attr($feature_list_title_tag) . '>';
932 }
933 echo '<p class="king-addons-feature-list-description">' . wp_kses_post($item['king_addons_feature_list_description']) . '</p>';
934 echo '</div>';
935 echo '</li>';
936 $count_items++;
937 }
938
939 echo '</ul>';
940 echo '</div>';
941 }
942 }
943 }