PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.0
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.0
4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1 2.3.1.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.4.0 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.2 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.6.0 3.6.1 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8.1 3.8.2 3.9.0 3.9.1 3.9.2 trunk 1.2.6 1.2.7 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.0.9.1 2.0.9.2 2.0.9.3
elementskit-lite / widgets / social / social.php
elementskit-lite / widgets / social Last commit date
readme.txt 5 years ago social-handler.php 3 years ago social.php 3 weeks ago
social.php
730 lines
1 <?php
2 namespace Elementor;
3
4 use \Elementor\ElementsKit_Widget_Social_Handler as Handler;
5 use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager;
6
7 if ( ! defined( 'ABSPATH' ) ) exit;
8
9 class ElementsKit_Widget_Social extends Widget_Base {
10 use \ElementsKit_Lite\Widgets\Widget_Notice;
11
12 public $base;
13
14 public function get_name() {
15 return Handler::get_name();
16 }
17
18 public function get_title() {
19 return Handler::get_title();
20 }
21
22 public function get_icon() {
23 return Handler::get_icon();
24 }
25
26 public function get_categories() {
27 return Handler::get_categories();
28 }
29
30 public function get_keywords() {
31 return Handler::get_keywords();
32 }
33
34 public function get_help_url() {
35 return 'https://wpmet.com/doc/social-media-widget/';
36 }
37
38 public function get_style_depends() {
39 return ['ekit-social'];
40 }
41
42 protected function is_dynamic_content(): bool {
43 return false;
44 }
45
46 protected function register_controls() {
47
48 // start content section for social media
49 $this->start_controls_section(
50 'ekit_socialmedia_section_tab_content',
51 [
52 'label' => esc_html__('Social Icons', 'elementskit-lite'),
53 ]
54 );
55
56 $this->add_control(
57 'ekit_socialmedia_style',
58 [
59 'label' => esc_html__( 'Choose Style', 'elementskit-lite' ),
60 'type' => Controls_Manager::SELECT,
61 'default' => 'icon',
62 'options' => [
63 'icon' => esc_html__( 'Icon', 'elementskit-lite' ),
64 'text' => esc_html__( 'Text', 'elementskit-lite' ),
65 'both' => esc_html__( 'Both', 'elementskit-lite' ),
66 ],
67 ]
68 );
69
70 $this->add_control(
71 'ekit_socialmedia_style_icon_position',
72 [
73 'label' => esc_html__( 'Icon Position', 'elementskit-lite' ),
74 'type' => Controls_Manager::SELECT,
75 'default' => 'before',
76 'options' => [
77 'before' => esc_html__( 'Before', 'elementskit-lite' ),
78 'after' => esc_html__( 'After', 'elementskit-lite' ),
79 ],
80 'condition' => [
81 'ekit_socialmedia_style' => 'both'
82 ]
83 ]
84 );
85
86 $this->add_responsive_control(
87 'ekit_socialmedia_icon_padding_right',
88 [
89 'label' => esc_html__( 'Spacing Right', 'elementskit-lite' ),
90 'type' => Controls_Manager::SLIDER,
91 'size_units' => [ 'px' ],
92 'range' => [
93 'px' => [
94 'min' => 5,
95 'max' => 100,
96 'step' => 1,
97 ],
98 ],
99 'default' => [
100 'unit' => 'px',
101 'size' => 5,
102 ],
103 'selectors' => [
104 '{{WRAPPER}} a > i' => 'padding-right: {{SIZE}}{{UNIT}};',
105 ],
106 'condition' => [
107 'ekit_socialmedia_style' => 'both',
108 'ekit_socialmedia_style_icon_position' => 'before',
109 ]
110 ]
111 );
112
113 $this->add_responsive_control(
114 'ekit_socialmedia_icon_padding_left',
115 [
116 'label' => esc_html__( 'Spacing Left', 'elementskit-lite' ),
117 'type' => Controls_Manager::SLIDER,
118 'size_units' => [ 'px' ],
119 'range' => [
120 'px' => [
121 'min' => 5,
122 'max' => 100,
123 'step' => 1,
124 ],
125 ],
126 'default' => [
127 'unit' => 'px',
128 'size' => 5,
129 ],
130 'selectors' => [
131 '{{WRAPPER}} a > i' => 'padding-left: {{SIZE}}{{UNIT}};',
132 ],
133 'condition' => [
134 'ekit_socialmedia_style' => 'both',
135 'ekit_socialmedia_style_icon_position' => 'after',
136 ]
137 ]
138 );
139
140 $this->add_responsive_control(
141 'ekit_socialmedai_list_align',
142 [
143 'label' => esc_html__( 'Alignment', 'elementskit-lite' ),
144 'type' => Controls_Manager::CHOOSE,
145 'options' => [
146 'left' => [
147 'title' => esc_html__( 'Left', 'elementskit-lite' ),
148 'icon' => 'eicon-text-align-left',
149 ],
150 'center' => [
151 'title' => esc_html__( 'Center', 'elementskit-lite' ),
152 'icon' => 'eicon-text-align-center',
153 ],
154 'right' => [
155 'title' => esc_html__( 'Right', 'elementskit-lite' ),
156 'icon' => 'eicon-text-align-right',
157 ],
158 ],
159 'default' => 'center',
160 'toggle' => true,
161 'selectors' => [
162 '{{WRAPPER}} .ekit_social_media' => 'text-align: {{VALUE}};',
163 ],
164 ]
165 );
166
167 $socialMedia = new Repeater();
168
169 // set social icon
170 $socialMedia->add_control(
171 'ekit_socialmedia_icons',
172 [
173 'label' => esc_html__( 'Icon', 'elementskit-lite' ),
174 'label_block' => true,
175 'type' => Controls_Manager::ICONS,
176 'fa4compatibility' => 'ekit_socialmedia_icon',
177 'default' => [
178 'value' => 'icon icon-facebook',
179 'library' => 'ekiticons',
180 ]
181 ]
182 );
183
184 // set social icon label
185 $socialMedia->add_control(
186 'ekit_socialmedia_label',
187 [
188 'label' => esc_html__( 'Label', 'elementskit-lite' ),
189 'type' => Controls_Manager::TEXT,
190 'dynamic' => [
191 'active' => true,
192 ],
193 'default' => 'Facebook',
194 ]
195 );
196
197 // set social link
198 $socialMedia->add_control(
199 'ekit_socialmedia_link',
200 [
201 'label' => esc_html__( 'Link', 'elementskit-lite' ),
202 'type' => Controls_Manager::URL,
203 'dynamic' => [
204 'active' => true,
205 ],
206 'default' => [
207 'url' => 'https://facebook.com',
208 ],
209 ]
210 );
211
212 // start tab for content
213 $socialMedia->start_controls_tabs(
214 'ekit_socialmedia_tabs'
215 );
216
217 // start normal tab
218 $socialMedia->start_controls_tab(
219 'ekit_socialmedia_normal',
220 [
221 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
222 ]
223 );
224
225 // set social icon color
226 $socialMedia->add_responsive_control(
227 'ekit_socialmedia_icon_color',
228 [
229 'label' =>esc_html__( 'Color', 'elementskit-lite' ),
230 'type' => Controls_Manager::COLOR,
231 'default' => '#222222',
232 'selectors' => [
233 '{{WRAPPER}} {{CURRENT_ITEM}} > a i' => 'color: {{VALUE}}',
234 '{{WRAPPER}} {{CURRENT_ITEM}} > a svg' => 'fill: {{VALUE}}',
235 ],
236 ]
237 );
238
239 // set social icon background color
240 $socialMedia->add_responsive_control(
241 'ekit_socialmedia_icon_bg_color',
242 [
243 'label' =>esc_html__( 'Background Color', 'elementskit-lite' ),
244 'type' => Controls_Manager::COLOR,
245 'selectors' => [
246 '{{WRAPPER}} {{CURRENT_ITEM}} > a' => 'background-color: {{VALUE}};',
247 ],
248 ]
249 );
250
251 $socialMedia->add_group_control(
252 Group_Control_Border::get_type(),
253 [
254 'name' => 'ekit_socialmedia_border',
255 'label' => esc_html__( 'Border', 'elementskit-lite' ),
256 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} > a',
257 ]
258 );
259
260 $socialMedia->add_group_control(
261 Group_Control_Text_Shadow::get_type(),
262 [
263 'name' => 'ekit_socialmedia_icon_normal_text_shadow',
264 'label' => esc_html__( 'Text Shadow', 'elementskit-lite' ),
265 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} > a',
266 ]
267 );
268
269 $socialMedia->add_group_control(
270 Group_Control_Box_Shadow::get_type(), [
271 'name' => 'ekit_socialmedai_list_box_shadow',
272 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} > a',
273 ]
274 );
275
276 $socialMedia->end_controls_tab();
277 // end normal tab
278
279 //start hover tab
280 $socialMedia->start_controls_tab(
281 'ekit_socialmedia_hover',
282 [
283 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
284 ]
285 );
286
287 // set social icon color
288 $socialMedia->add_responsive_control(
289 'ekit_socialmedia_icon_hover_color',
290 [
291 'label' =>esc_html__( 'Color', 'elementskit-lite' ),
292 'type' => Controls_Manager::COLOR,
293 'selectors' => [
294 '{{WRAPPER}} {{CURRENT_ITEM}} > a:hover' => 'color: {{VALUE}};',
295 '{{WRAPPER}} {{CURRENT_ITEM}} > a:hover svg' => 'fill: {{VALUE}};',
296 ],
297 ]
298 );
299
300 // set social icon background color
301 $socialMedia->add_responsive_control(
302 'ekit_socialmedia_icon_hover_bg_color',
303 [
304 'label' =>esc_html__( 'Background Color', 'elementskit-lite' ),
305 'type' => Controls_Manager::COLOR,
306 'default' => '#3b5998',
307 'selectors' => [
308 '{{WRAPPER}} {{CURRENT_ITEM}} > a:hover' => 'background-color: {{VALUE}};',
309 ],
310 ]
311 );
312
313
314 $socialMedia->add_group_control(
315 Group_Control_Text_Shadow::get_type(),
316 [
317 'name' => 'ekit_socialmedia_icon_hover_text_shadow',
318 'label' => esc_html__( 'Text Shadow', 'elementskit-lite' ),
319 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} > a:hover',
320 ]
321 );
322
323 $socialMedia->add_group_control(
324 Group_Control_Box_Shadow::get_type(), [
325 'name' => 'ekit_socialmedai_list_box_shadow_hover',
326 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} > a:hover',
327 ]
328 );
329
330 $socialMedia->add_group_control(
331 Group_Control_Border::get_type(),
332 [
333 'name' => 'ekit_socialmedia_border_hover',
334 'label' => esc_html__( 'Border', 'elementskit-lite' ),
335 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} > a:hover',
336 ]
337 );
338
339 $socialMedia->end_controls_tab();
340 //end hover tab
341
342 $socialMedia->end_controls_tabs();
343
344
345 // set social icon add new control
346 $this->add_control(
347 'ekit_socialmedia_add_icons',
348 [
349 'label' => esc_html__('Add Social Media', 'elementskit-lite'),
350 'type' => Controls_Manager::REPEATER,
351 'fields' => $socialMedia->get_controls(),
352 'default' => [
353 [
354 'ekit_socialmedia_icons' => [
355 'value' => 'icon icon-facebook',
356 'library' => 'ekiticons'
357 ],
358 'ekit_socialmedia_label' => 'Facebook',
359 'ekit_socialmedia_icon_hover_bg_color' => '#3b5998',
360 ],
361 [
362 'ekit_socialmedia_icons' => [
363 'value' => 'icon icon-twitter',
364 'library' => 'ekiticons'
365 ],
366 'ekit_socialmedia_label' => 'Twitter',
367 'ekit_socialmedia_icon_hover_bg_color' => '#1da1f2',
368 ],
369 [
370 'ekit_socialmedia_icons' => [
371 'value' => 'icon icon-linkedin',
372 'library' => 'ekiticons'
373 ],
374 'ekit_socialmedia_label' => 'LinkedIn',
375 'ekit_socialmedia_icon_hover_bg_color' => '#0077b5',
376 ],
377 ],
378 'title_field' => '{{{ ekit_socialmedia_label }}}',
379
380 ]
381 );
382
383 $this->end_controls_section();
384 // end content section
385
386 // start style section control
387
388 // start Social media tab
389 $this->start_controls_section(
390 'ekit_socialmedia_section_tab_style',
391 [
392 'label' => esc_html__('Social Media', 'elementskit-lite'),
393 'tab' => Controls_Manager::TAB_STYLE,
394 ]
395 );
396 // Alignment
397 $this->add_responsive_control(
398 'ekit_socialmedai_list_item_align',
399 [
400 'label' => esc_html__( 'Alignment', 'elementskit-lite' ),
401 'type' => Controls_Manager::CHOOSE,
402 'options' => [
403 'left' => [
404 'title' => esc_html__( 'Left', 'elementskit-lite' ),
405 'icon' => 'eicon-text-align-left',
406 ],
407 'center' => [
408 'title' => esc_html__( 'Center', 'elementskit-lite' ),
409 'icon' => 'eicon-text-align-center',
410 ],
411 'right' => [
412 'title' => esc_html__( 'Right', 'elementskit-lite' ),
413 'icon' => 'eicon-text-align-right',
414 ],
415 ],
416 'default' => 'center',
417 'toggle' => true,
418 'selectors' => [
419 '{{WRAPPER}} .ekit_social_media > li > a' => 'text-align: {{VALUE}};',
420 ],
421 ]
422 );
423
424 // Display design
425 $this->add_responsive_control(
426 'ekit_socialmedai_list_display',
427 [
428 'label' => esc_html__( 'Display', 'elementskit-lite' ),
429 'type' => Controls_Manager::SELECT,
430 'default' => 'inline-block',
431 'options' => [
432 'inline-block' => esc_html__( 'Inline Block', 'elementskit-lite' ),
433 'block' => esc_html__( 'Block', 'elementskit-lite' ),
434 ],
435 'selectors' => [
436 '{{WRAPPER}} .ekit_social_media > li' => 'display: {{VALUE}};',
437 ],
438 ]
439 );
440
441 // text decoration
442 $this->add_responsive_control(
443 'ekit_socialmedai_list_decoration_box',
444 [
445 'label' => esc_html__( 'Decoration', 'elementskit-lite' ),
446 'type' => Controls_Manager::SELECT,
447 'default' => 'none',
448 'options' => [
449 'none' => esc_html__( 'None', 'elementskit-lite' ),
450 'underline' => esc_html__( 'Underline', 'elementskit-lite' ),
451 'overline' => esc_html__( 'Overline', 'elementskit-lite' ),
452 'line-through' => esc_html__( 'Line Through', 'elementskit-lite' ),
453
454 ],
455 'selectors' => ['{{WRAPPER}} .ekit_social_media > li > a' => 'text-decoration: {{VALUE}};'],
456 ]
457 );
458
459 // border radius
460 $this->add_responsive_control(
461 'ekit_socialmedai_list_border_radius',
462 [
463 'label' => esc_html__( 'Border radius', 'elementskit-lite' ),
464 'type' => Controls_Manager::DIMENSIONS,
465 'size_units' => [ 'px', '%', 'em' ],
466 'default' => [
467 'top' => '50',
468 'right' => '50',
469 'bottom' => '50' ,
470 'left' => '50',
471 'unit' => '%',
472 ],
473 'selectors' => [
474 '{{WRAPPER}} .ekit_social_media > li > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
475 ],
476 ]
477 );
478
479 // Padding style
480
481 $this->add_responsive_control(
482 'ekit_socialmedai_list_padding',
483 [
484 'label' => esc_html__('Padding', 'elementskit-lite'),
485 'type' => Controls_Manager::DIMENSIONS,
486 'size_units' => ['px', 'em'],
487 'selectors' => [
488 '{{WRAPPER}} .ekit_social_media > li > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
489 ],
490 ]
491 );
492
493 // margin style
494
495 $this->add_responsive_control(
496 'ekit_socialmedai_list_margin',
497 [
498 'label' => esc_html__('Margin', 'elementskit-lite'),
499 'type' => Controls_Manager::DIMENSIONS,
500 'size_units' => ['px', 'em'],
501 'default' => [
502 'top' => '5',
503 'right' => '5',
504 'bottom' => '5' ,
505 'left' => '5',
506 ],
507 'selectors' => [
508 '{{WRAPPER}} .ekit_social_media > li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
509 ],
510 ]
511 );
512
513 $this->add_responsive_control(
514 'ekit_socialmedai_list_icon_size',
515 [
516 'label' => esc_html__( 'Icon Size', 'elementskit-lite' ),
517 'type' => Controls_Manager::SLIDER,
518 'size_units' => [ 'px', '%' ],
519 'range' => [
520 'px' => [
521 'min' => 1,
522 'max' => 100,
523 'step' => 5,
524 ],
525 '%' => [
526 'min' => 1,
527 'max' => 100,
528 ],
529 ],
530 'selectors' => [
531 '{{WRAPPER}} .ekit_social_media > li > a i' => 'font-size: {{SIZE}}{{UNIT}};',
532 '{{WRAPPER}} .ekit_social_media > li > a svg' => 'max-width: {{SIZE}}{{UNIT}};',
533 ],
534 ]
535 );
536
537 $this->add_group_control(
538 Group_Control_Typography::get_type(),
539 [
540 'name' => 'ekit_socialmedai_list_typography',
541 'label' => esc_html__( 'Typography', 'elementskit-lite' ),
542 'selector' => '{{WRAPPER}} .ekit_social_media > li > a',
543 ]
544 );
545
546 $this->add_control(
547 'ekit_socialmedai_list_style_use_height_and_width',
548 [
549 'label' => esc_html__( 'Use Height Width', 'elementskit-lite' ),
550 'type' => Controls_Manager::SWITCHER,
551 'label_on' => esc_html__( 'Show', 'elementskit-lite' ),
552 'label_off' => esc_html__( 'Hide', 'elementskit-lite' ),
553 'return_value' => 'yes',
554 'default' => 'yes',
555 ]
556 );
557
558
559 $this->add_responsive_control(
560 'ekit_socialmedai_list_width',
561 [
562 'label' => esc_html__( 'Width', 'elementskit-lite' ),
563 'type' => Controls_Manager::SLIDER,
564 'size_units' => [ 'px', '%' ],
565 'range' => [
566 'px' => [
567 'min' => 0,
568 'max' => 200,
569 'step' => 1,
570 ],
571 '%' => [
572 'min' => 0,
573 'max' => 100,
574 ],
575 ],
576 'default' => [
577 'unit' => 'px',
578 'size' => 30,
579 ],
580 'selectors' => [
581 '{{WRAPPER}} .ekit_social_media > li > a' => 'width: {{SIZE}}{{UNIT}};',
582 ],
583 'condition' => [
584 'ekit_socialmedai_list_style_use_height_and_width' => 'yes',
585 'ekit_socialmedia_style' => 'icon',
586 ]
587 ]
588 );
589
590 $this->add_responsive_control(
591 'ekit_socialmedai_list_height',
592 [
593 'label' => esc_html__( 'Height', 'elementskit-lite' ),
594 'type' => Controls_Manager::SLIDER,
595 'size_units' => [ 'px', '%' ],
596 'range' => [
597 'px' => [
598 'min' => 0,
599 'max' => 200,
600 'step' => 1,
601 ],
602 '%' => [
603 'min' => 0,
604 'max' => 100,
605 ],
606 ],
607 'default' => [
608 'unit' => 'px',
609 'size' => 30,
610 ],
611 'selectors' => [
612 '{{WRAPPER}} .ekit_social_media > li > a' => 'height: {{SIZE}}{{UNIT}};',
613 ],
614 'condition' => [
615 'ekit_socialmedai_list_style_use_height_and_width' => 'yes',
616 'ekit_socialmedia_style' => 'icon',
617 ]
618 ]
619 );
620
621 $this->add_responsive_control(
622 'ekit_socialmedai_list_line_height',
623 [
624 'label' => esc_html__( 'Line Height', 'elementskit-lite' ),
625 'type' => Controls_Manager::SLIDER,
626 'size_units' => [ 'px', '%' ],
627 'range' => [
628 'px' => [
629 'min' => 0,
630 'max' => 200,
631 'step' => 1,
632 ],
633 '%' => [
634 'min' => 0,
635 'max' => 100,
636 ],
637 ],
638 'default' => [
639 'unit' => 'px',
640 'size' => 28,
641 ],
642 'selectors' => [
643 '{{WRAPPER}} .ekit_social_media > li > a' => 'line-height: {{SIZE}}{{UNIT}};',
644 ],
645 'condition' => [
646 'ekit_socialmedai_list_style_use_height_and_width' => 'yes'
647 ]
648 ]
649 );
650
651
652 $this->end_controls_section();
653
654 $this->insert_pro_message();
655 }
656 protected function render( ) {
657 echo '<div class="ekit-wid-con" >';
658 $this->render_raw();
659 echo '</div>';
660 }
661
662 protected function render_raw( ) {
663 $settings = $this->get_settings();
664 extract($settings);
665
666 ?>
667 <ul class="ekit_social_media">
668 <?php foreach ($ekit_socialmedia_add_icons as $key => $icon): ?>
669 <?php if($icon['ekit_socialmedia_icons'] != ''):
670
671 if ( ! empty( $icon['ekit_socialmedia_link']['url'] ) ) {
672 $this->add_link_attributes( 'button-' . $key, $icon['ekit_socialmedia_link'] );
673 $this->add_render_attribute( 'button-' . $key, 'aria-label', $icon['ekit_socialmedia_label'] );
674 }
675
676 ?>
677 <li class="elementor-repeater-item-<?php echo esc_attr( $icon[ '_id' ] ); ?>">
678 <a
679 <?php echo $this->get_render_attribute_string( 'button-' . $key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor
680
681 // new icon
682 $migrated = isset( $icon['__fa4_migrated']['ekit_socialmedia_icons'] );
683 // Check if its a new widget without previously selected icon using the old Icon control
684 $is_new = empty( $icon['ekit_socialmedia_icon'] );
685
686
687
688 $getClass = explode('-', ($is_new || $migrated) ? $icon['ekit_socialmedia_icons']['library'] != 'svg' ? $icon['ekit_socialmedia_icons']['value'] : '' : $icon['ekit_socialmedia_icon'] );
689 $iconClass = !empty($getClass) ? end($getClass) : ''; ?> class="<?php echo esc_attr( $iconClass ); ?>" >
690 <?php if($settings['ekit_socialmedia_style'] != 'text' && $settings['ekit_socialmedia_style_icon_position'] == 'before'): ?>
691
692 <?php
693 if ( $is_new || $migrated ) {
694 // new icon
695 Icons_Manager::render_icon( $icon['ekit_socialmedia_icons'], [ 'aria-hidden' => 'true' ] );
696 } else {
697 ?>
698 <i class="<?php echo esc_attr($icon['ekit_socialmedia_icon']); ?>" aria-hidden="true"></i>
699 <?php
700 }
701 ?>
702
703 <?php endif; ?>
704 <?php if($settings['ekit_socialmedia_style'] != 'icon' ): ?>
705 <?php echo esc_html($icon['ekit_socialmedia_label'])?>
706 <?php endif; ?>
707 <?php if($settings['ekit_socialmedia_style'] != 'text' && $settings['ekit_socialmedia_style_icon_position'] == 'after'): ?>
708
709 <?php
710
711 if ( $is_new || $migrated ) {
712 // new icon
713 Icons_Manager::render_icon( $icon['ekit_socialmedia_icons'], [ 'aria-hidden' => 'true' ] );
714 } else {
715 ?>
716 <i class="<?php echo esc_attr($icon['ekit_socialmedia_icon']); ?>" aria-hidden="true"></i>
717 <?php
718 }
719 ?>
720
721 <?php endif; ?>
722 </a>
723 </li>
724 <?php endif; ?>
725 <?php endforeach; ?>
726 </ul>
727 <?php
728 }
729 }
730