PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.1.4
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.1.4
4.5.4 4.2.1 4.2.2 4.2.3 4.5.0 4.5.2 4.5.3 4.2.0 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 All 146 releases
ultimate-post-kit / modules / static-social-count / widgets / static-social-count.php

static-social-count.php in Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets 4.1.4, at modules/static-social-count/widgets/static-social-count.php

837 lines 22.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimatePostKit\Modules\StaticSocialCount\Widgets;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Typography;
7 use Elementor\Group_Control_Border;
8 use Elementor\Group_Control_Background;
9 use Elementor\Repeater;
10 use Elementor\Icons_Manager;
11 use Elementor\Group_Control_Box_Shadow;
12 use UltimatePostKit\Includes\Controls\GroupQuery\Group_Control_Query;
13
14 if (!defined('ABSPATH')) {
15 exit;
16 }
17
18 class Static_Social_Count extends Group_Control_Query {
19 public function get_name() {
20 return 'upk-static-social-count';
21 }
22
23 public function get_title() {
24 return BDTUPK . esc_html__('Social Count (Static)', 'ultimate-post-kit');
25 }
26
27 public function get_icon() {
28 return 'upk-widget-icon upk-icon-static-social-count';
29 }
30
31 public function get_categories() {
32 return ['ultimate-post-kit'];
33 }
34
35 public function get_style_depends() {
36 if ($this->upk_is_edit_mode()) {
37 return ['upk-all-styles'];
38 } else {
39 return ['upk-font', 'upk-static-social-count'];
40 }
41 }
42 public function get_script_depends() {
43 if ($this->upk_is_edit_mode()) {
44 return ['upk-all-scripts'];
45 } else {
46 return ['upk-static-social-count'];
47 }
48 }
49
50 public function get_keywords() {
51 return ['post', 'grid', 'blog', 'recent', 'news', 'social-count', 'count'];
52 }
53
54 public function get_custom_help_url() {
55 return 'https://youtu.be/MmbdYPee9qw';
56 }
57
58 public function has_widget_inner_wrapper(): bool {
59 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
60 }
61 protected function is_dynamic_content(): bool {
62 return false;
63 }
64
65 protected function register_controls() {
66 $this->start_controls_section(
67 'section_layout',
68 [
69 'label' => esc_html__('Layout', 'ultimate-post-kit'),
70 ]
71 );
72
73 $this->add_control(
74 'select_style',
75 [
76 'label' => esc_html__('Select Style', 'ultimate-post-kit') . BDTUPK_NC,
77 'type' => Controls_Manager::SELECT,
78 'default' => '',
79 'options' => [
80 '' => esc_html__('Style 1', 'ultimate-post-kit'),
81 'upk-style-2' => esc_html__('Style 2', 'ultimate-post-kit'),
82 'upk-style-3' => esc_html__('Style 3', 'ultimate-post-kit'),
83 ],
84 ]
85 );
86
87 $this->add_responsive_control(
88 'grid_columns',
89 [
90 'label' => __('Columns', 'ultimate-post-kit'),
91 'type' => Controls_Manager::SELECT,
92 'default' => '4',
93 'tablet_default' => '4',
94 'mobile_default' => '1',
95 'options' => [
96 '1' => '1',
97 '2' => '2',
98 '3' => '3',
99 '4' => '4',
100 '5' => '5',
101 '6' => '6',
102 ],
103 'selectors' => [
104 '{{WRAPPER}} .upk-static-social-count' => ' grid-template-columns: repeat({{VALUE}}, 1fr);'
105 ],
106 // 'condition' => [
107 // 'select_layout' => 'grid'
108 // ]
109 ]
110 );
111
112 $this->add_responsive_control(
113 'social_icon_space_between',
114 [
115 'label' => esc_html__('Column Gap', 'ultimate-post-kit'),
116 'type' => Controls_Manager::SLIDER,
117 'size_units' => ['px'],
118 'range' => [
119 'px' => [
120 'min' => 0,
121 'max' => 100,
122 'step' => 1,
123 ]
124 ],
125 'selectors' => [
126 '{{WRAPPER}} .upk-static-social-count' => 'grid-gap: {{SIZE}}{{UNIT}};',
127 ],
128 'separator' => 'before'
129 ]
130 );
131 $this->end_controls_section();
132 $this->start_controls_section(
133 'section_social_sites',
134 [
135 'label' => esc_html__('Social Count', 'ultimate-post-kit'),
136 ]
137 );
138 $repeater = new Repeater();
139 $repeater->start_controls_tabs(
140 'social_count_tabs'
141 );
142 $repeater->start_controls_tab(
143 'social_count_tabs_content',
144 [
145 'label' => esc_html__('Content', 'ultimate-post-kit'),
146 ]
147 );
148 $repeater->add_control(
149 'social_site_name',
150 [
151 'label' => esc_html__('Label', 'ultimate-post-kit'),
152 'type' => Controls_Manager::TEXT,
153 'placeholder' => esc_html__('facebook', 'ultimate-post-kit'),
154 'dynamic' => [
155 'active' => true,
156 ],
157 ]
158 );
159 $repeater->add_control(
160 'social_site_link',
161 [
162 'label' => esc_html__('Link', 'ultimate-post-kit'),
163 'type' => Controls_Manager::URL,
164 'dynamic' => [ 'active' => true ],
165 'placeholder' => esc_html__('https://facebook.com', 'ultimate-post-kit'),
166 'show_external' => true,
167 'default' => [
168 'url' => 'https://bdthemes.com',
169 'is_external' => true,
170 'nofollow' => true,
171 ],
172 ]
173 );
174 $repeater->add_control(
175 'social_site_icon',
176 [
177 'label' => esc_html__('Icon', 'ultimate-post-kit'),
178 'type' => Controls_Manager::ICONS,
179 'default' => [
180 'value' => 'fab fa-wordpress',
181 'library' => 'fa-brands',
182 ],
183 'recommended' => [
184 'fa-brands' => [
185 'android',
186 'apple',
187 'behance',
188 'bitbucket',
189 'codepen',
190 'delicious',
191 'deviantart',
192 'digg',
193 'dribbble',
194 'elementor',
195 'facebook',
196 'flickr',
197 'foursquare',
198 'free-code-camp',
199 'github',
200 'gitlab',
201 'globe',
202 'houzz',
203 'instagram',
204 'jsfiddle',
205 'linkedin',
206 'medium',
207 'meetup',
208 'mix',
209 'mixcloud',
210 'odnoklassniki',
211 'pinterest',
212 'product-hunt',
213 'reddit',
214 'shopping-cart',
215 'skype',
216 'slideshare',
217 'snapchat',
218 'soundcloud',
219 'spotify',
220 'stack-overflow',
221 'steam',
222 'telegram',
223 'thumb-tack',
224 'tripadvisor',
225 'tumblr',
226 'twitch',
227 'twitter',
228 'viber',
229 'vimeo',
230 'vk',
231 'weibo',
232 'weixin',
233 'whatsapp',
234 'wordpress',
235 'xing',
236 'yelp',
237 'youtube',
238 '500px',
239 ],
240 'fa-solid' => [
241 'envelope',
242 'link',
243 'rss',
244 ],
245 ],
246 'skin' => 'inline',
247 'label_block' => false
248 ]
249 );
250 $repeater->add_control(
251 'social_counter',
252 [
253 'label' => esc_html__('Number', 'ultimate-post-kit'),
254 'type' => Controls_Manager::TEXT,
255 'dynamic' => [
256 'active' => true,
257 ],
258 ]
259 );
260 $repeater->add_control(
261 'social_site_meta',
262 [
263 'label' => esc_html__('Meta', 'ultimate-post-kit'),
264 'type' => Controls_Manager::TEXT,
265 'dynamic' => [
266 'active' => true,
267 ],
268 ]
269 );
270 $repeater->end_controls_tab();
271 $repeater->start_controls_tab(
272 'social_count_tabs_style',
273 [
274 'label' => esc_html__('Style', 'ultimate-post-kit'),
275 ]
276 );
277 $repeater->add_group_control(
278 Group_Control_Background::get_type(),
279 [
280 'name' => 'social_single_item_bg',
281 'label' => esc_html__('Background', 'ultimate-post-kit'),
282 'types' => ['classic', 'gradient'],
283 'exclude' => ['image'],
284 'selector' => '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}}.upk-item',
285 ]
286 );
287 $repeater->add_control(
288 'heading_icon_social_single',
289 [
290 'label' => esc_html__('ICON NORMAL', 'ultimate-post-kit'),
291 'type' => Controls_Manager::HEADING,
292 'separator' => 'before',
293 ]
294 );
295 $repeater->add_control(
296 'social_single_color',
297 [
298 'label' => esc_html__('Color', 'ultimate-post-kit'),
299 'type' => Controls_Manager::COLOR,
300 'selectors' => [
301 '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}} .upk-icon span' => 'color: {{VALUE}};',
302 ],
303 ]
304 );
305 $repeater->add_control(
306 'social_single_bg_color',
307 [
308 'label' => esc_html__('Background', 'ultimate-post-kit'),
309 'type' => Controls_Manager::COLOR,
310 'selectors' => [
311 '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}} .upk-icon span' => 'background: {{VALUE}};',
312 ],
313 ]
314 );
315 $repeater->add_control(
316 'social_single_border_color',
317 [
318 'label' => esc_html__('Border', 'ultimate-post-kit'),
319 'type' => Controls_Manager::COLOR,
320 'selectors' => [
321 '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}} .upk-icon span' => 'border-color: {{VALUE}};',
322 ],
323 ]
324 );
325 $repeater->add_control(
326 'heading_icon_h_social_single',
327 [
328 'label' => esc_html__('ICON HOVER', 'ultimate-post-kit'),
329 'type' => Controls_Manager::HEADING,
330 'separator' => 'before',
331 ]
332 );
333 $repeater->add_control(
334 'social_single_h_color',
335 [
336 'label' => esc_html__('Color', 'ultimate-post-kit'),
337 'type' => Controls_Manager::COLOR,
338 'selectors' => [
339 '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}} .upk-icon:hover span' => 'color:{{VALUE}}',
340 ],
341 ]
342 );
343 $repeater->add_control(
344 'social_single_h_bg_color',
345 [
346 'label' => esc_html__('Background', 'ultimate-post-kit'),
347 'type' => Controls_Manager::COLOR,
348 'selectors' => [
349 '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}} .upk-icon:hover span' => 'background: {{VALUE}};',
350 ],
351 ]
352 );
353 $repeater->add_control(
354 'social_single_h_border_color',
355 [
356 'label' => esc_html__('Border', 'ultimate-post-kit'),
357 'type' => Controls_Manager::COLOR,
358 'selectors' => [
359 '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}} .upk-icon:hover span' => 'border-color: {{VALUE}};',
360 ],
361 ]
362 );
363 $repeater->add_control(
364 'heading_number_social_single',
365 [
366 'label' => esc_html__('NUMBER', 'ultimate-post-kit'),
367 'type' => Controls_Manager::HEADING,
368 'separator' => 'before',
369 ]
370 );
371 $repeater->add_control(
372 'social_single_count_color',
373 [
374 'label' => esc_html__('Color', 'ultimate-post-kit'),
375 'type' => Controls_Manager::COLOR,
376 'selectors' => [
377 '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}} .upk-count .counter-value' => 'color: {{VALUE}};',
378 ],
379 ]
380 );
381
382 $repeater->add_control(
383 'heading_meta_social_single',
384 [
385 'label' => esc_html__('META', 'ultimate-post-kit'),
386 'type' => Controls_Manager::HEADING,
387 'separator' => 'before',
388 ]
389 );
390 $repeater->add_control(
391 'social_single_meta_color',
392 [
393 'label' => esc_html__('Color', 'ultimate-post-kit'),
394 'type' => Controls_Manager::COLOR,
395 'selectors' => [
396 '{{WRAPPER}} .upk-static-social-count {{CURRENT_ITEM}} .upk-meta' => 'color: {{VALUE}};',
397 ],
398 ]
399 );
400 $repeater->end_controls_tab();
401 $repeater->end_controls_tabs();
402 $this->add_control(
403 'social_counter_list',
404 [
405 'label' => esc_html__('Social', 'ultimate-post-kit'),
406 'type' => Controls_Manager::REPEATER,
407 'fields' => $repeater->get_controls(),
408 'default' => [
409 [
410 'social_site_name' => esc_html__('Facebook', 'ultimate-post-kit'),
411 'social_site_icon' => [
412 'value' => 'fab fa-facebook',
413 'library' => 'fa-brands',
414 ],
415 'social_counter' => '450',
416 'social_site_meta' => esc_html__('Likes', 'ultimate-post-kit'),
417 'social_site_link' => [
418 'url' => esc_html__('https://facebook.com/bdthemes', 'ultimate-post-kit')
419 ]
420 ],
421 [
422 'social_site_name' => esc_html__('Twitter', 'ultimate-post-kit'),
423 'social_site_icon' => [
424 'value' => 'fab fa-twitter',
425 'library' => 'fa-brands',
426 ],
427 'social_counter' => '3000',
428 'social_site_meta' => esc_html__('Followers', 'ultimate-post-kit'),
429 'social_site_link' => [
430 'url' => esc_html__('https://twitter.com/bdthemescom', 'ultimate-post-kit')
431 ]
432 ],
433 [
434 'social_site_name' => esc_html__('Youtube', 'ultimate-post-kit'),
435 'social_site_icon' => [
436 'value' => 'fab fa-youtube',
437 'library' => 'fa-brands',
438 ],
439 'social_counter' => '2000000',
440 'social_site_meta' => esc_html__('Subscriber', 'ultimate-post-kit'),
441 'social_site_link' => [
442 'url' => esc_html__('https://youtube.com/bdthemes', 'ultimate-post-kit')
443 ]
444 ],
445 [
446 'social_site_name' => esc_html__('Instagram', 'ultimate-post-kit'),
447 'social_site_icon' => [
448 'value' => 'fab fa-instagram',
449 'library' => 'fa-brands',
450 ],
451 'social_counter' => '105000',
452 'social_site_meta' => esc_html__('Followers', 'ultimate-post-kit'),
453 'social_site_link' => [
454 'url' => esc_html__('https://instagram.com/bdthemes', 'ultimate-post-kit')
455 ]
456 ],
457 ],
458 'title_field' => '{{{ social_site_name }}}',
459 ]
460 );
461 $this->end_controls_section();
462 $this->start_controls_section(
463 'static_social_items',
464 [
465 'label' => esc_html__('Items', 'ultimate-post-kit'),
466 'tab' => Controls_Manager::TAB_STYLE,
467 ]
468 );
469 $this->start_controls_tabs(
470 'static_social_item_tabs'
471 );
472 $this->start_controls_tab(
473 'static_social_tab_normal',
474 [
475 'label' => esc_html__('Normal', 'ultimate-post-kit'),
476 ]
477 );
478 $this->add_group_control(
479 Group_Control_Background::get_type(),
480 [
481 'name' => 'social_static_background',
482 'label' => esc_html__('Background', 'ultimate-post-kit'),
483 'types' => ['classic', 'gradient'],
484 'exclude' => ['image'],
485 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-item',
486 ]
487 );
488 $this->add_group_control(
489 Group_Control_Border::get_type(),
490 [
491 'name' => 'social_static_border',
492 'label' => esc_html__('Border', 'ultimate-post-kit'),
493 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-item',
494 ]
495 );
496 $this->add_responsive_control(
497 'social_static_padding',
498 [
499 'label' => esc_html__('Padding', 'ultimate-post-kit'),
500 'type' => Controls_Manager::DIMENSIONS,
501 'size_units' => ['px', '%', 'em'],
502 'selectors' => [
503 '{{WRAPPER}} .upk-static-social-count .upk-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
504 ],
505 ]
506 );
507
508 $this->add_responsive_control(
509 'social_static_border_radius',
510 [
511 'label' => esc_html__('Radius', 'ultimate-post-kit'),
512 'type' => Controls_Manager::DIMENSIONS,
513 'size_units' => ['px', '%', 'em'],
514 'selectors' => [
515 '{{WRAPPER}} .upk-static-social-count .upk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
516 ],
517 ]
518 );
519 $this->add_group_control(
520 Group_Control_Box_Shadow::get_type(),
521 [
522 'name' => 'static_social_shadow',
523 'label' => esc_html__('Box Shadow', 'ultimate-post-kit'),
524 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-item',
525 ]
526 );
527 $this->end_controls_tab();
528 $this->start_controls_tab(
529 'static_social_tab_hover',
530 [
531 'label' => esc_html__('Hover', 'ultimate-post-kit'),
532 ]
533 );
534 $this->add_group_control(
535 Group_Control_Background::get_type(),
536 [
537 'name' => 'static_social_hover_bg',
538 'label' => esc_html__('Background', 'ultimate-post-kit'),
539 'types' => ['classic', 'gradient'],
540 'exclude' => ['image'],
541 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-item:hover',
542 ]
543 );
544 $this->end_controls_tab();
545 $this->end_controls_tabs();
546 $this->end_controls_section();
547 $this->start_controls_section(
548 'section_social_count_style',
549 [
550 'label' => esc_html__('Icon', 'ultimate-post-kit'),
551 'tab' => Controls_Manager::TAB_STYLE,
552 ]
553 );
554 $this->start_controls_tabs(
555 'social_icons_tab'
556 );
557 $this->start_controls_tab(
558 'social_icon_tab_normal',
559 [
560 'label' => esc_html__('Normal', 'ultimate-post-kit'),
561 ]
562 );
563 $this->add_control(
564 'icon_color',
565 [
566 'label' => esc_html__('Color', 'ultimate-post-kit'),
567 'type' => Controls_Manager::COLOR,
568 'selectors' => [
569 '{{WRAPPER}} .upk-static-social-count .upk-icon span' => 'color: {{VALUE}}',
570 ],
571 ]
572 );
573 $this->add_group_control(
574 Group_Control_Background::get_type(),
575 [
576 'name' => 'icon_background',
577 'label' => esc_html__('Background', 'ultimate-post-kit'),
578 'types' => ['classic', 'gradient'],
579 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-icon span',
580 ]
581 );
582 $this->add_group_control(
583 Group_Control_Border::get_type(),
584 [
585 'name' => 'social_icons_border',
586 'label' => esc_html__('Border', 'ultimate-post-kit'),
587 'placeholder' => '1px',
588 'default' => '1px',
589 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-icon span',
590 ]
591 );
592 $this->add_responsive_control(
593 'social_icon_padding',
594 [
595 'label' => esc_html__('Padding', 'ultimate-post-kit'),
596 'type' => Controls_Manager::DIMENSIONS,
597 'size_units' => ['px', '%', 'em'],
598 'selectors' => [
599 '{{WRAPPER}} .upk-static-social-count .upk-icon span ' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
600 ],
601 ]
602 );
603 $this->add_responsive_control(
604 'social_icon_radius',
605 [
606 'label' => esc_html__('Radius', 'ultimate-post-kit'),
607 'type' => Controls_Manager::DIMENSIONS,
608 'size_units' => ['px', '%', 'em'],
609 'selectors' => [
610 '{{WRAPPER}} .upk-static-social-count .upk-icon span ' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
611 ],
612 ]
613 );
614 $this->add_responsive_control(
615 'social_icon_size',
616 [
617 'label' => esc_html__('Size', 'ultimate-post-kit'),
618 'type' => Controls_Manager::SLIDER,
619 'size_units' => ['px'],
620 'range' => [
621 'px' => [
622 'min' => 0,
623 'max' => 100,
624 'step' => 1,
625 ]
626 ],
627 'selectors' => [
628 '{{WRAPPER}} .upk-static-social-count .upk-icon span' => 'font-size: {{SIZE}}{{UNIT}};',
629 ]
630 ]
631 );
632 $this->add_responsive_control(
633 'social_icon_spacing',
634 [
635 'label' => esc_html__('Bottom Spacing', 'ultimate-post-kit'),
636 'type' => Controls_Manager::SLIDER,
637 'size_units' => ['px'],
638 'range' => [
639 'px' => [
640 'min' => 0,
641 'max' => 100,
642 'step' => 1,
643 ]
644 ],
645 'selectors' => [
646 '{{WRAPPER}} .upk-static-social-count .upk-icon' => 'margin-bottom: {{SIZE}}{{UNIT}};',
647 ],
648 'condition' => [
649 'select_style' => ''
650 ]
651 ]
652 );
653 $this->add_responsive_control(
654 'social_icon_spacing_left',
655 [
656 'label' => esc_html__('Spacing', 'ultimate-post-kit'),
657 'type' => Controls_Manager::SLIDER,
658 'size_units' => ['px'],
659 'range' => [
660 'px' => [
661 'min' => 0,
662 'max' => 100,
663 'step' => 1,
664 ]
665 ],
666 'selectors' => [
667 '{{WRAPPER}} .upk-static-social-count .upk-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
668 ],
669 'condition' => [
670 'select_style' => 'upk-style-2'
671 ]
672 ]
673 );
674 $this->end_controls_tab();
675 $this->start_controls_tab(
676 'social_icon_tab_hover',
677 [
678 'label' => esc_html__('Hover', 'ultimate-post-kit'),
679 ]
680 );
681 $this->add_control(
682 'icon_h_color',
683 [
684 'label' => esc_html__('Color', 'ultimate-post-kit'),
685 'type' => Controls_Manager::COLOR,
686 'selectors' => [
687 '{{WRAPPER}} .upk-static-social-count .upk-icon span:hover' => 'color: {{VALUE}}',
688 ],
689 ]
690 );
691 $this->add_group_control(
692 Group_Control_Background::get_type(),
693 [
694 'name' => 'icon_h_background',
695 'label' => esc_html__('Background', 'ultimate-post-kit'),
696 'types' => ['classic', 'gradient'],
697 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-icon span:hover',
698 ]
699 );
700 $this->add_control(
701 'icon_h_border_color',
702 [
703 'label' => esc_html__('Border Color', 'ultimate-post-kit'),
704 'type' => Controls_Manager::COLOR,
705 'selectors' => [
706 '{{WRAPPER}} .upk-static-social-count .upk-icon span:hover' => 'border-color: {{VALUE}}',
707 ],
708 'condition' => [
709 'social_icons_border_border!' => ''
710 ]
711 ]
712 );
713 $this->end_controls_tab();
714 $this->end_controls_tabs();
715 $this->end_controls_section();
716 $this->start_controls_section(
717 'social_counter',
718 [
719 'label' => esc_html__('Counter', 'ultimate-post-kit'),
720 'tab' => Controls_Manager::TAB_STYLE,
721 ]
722 );
723 $this->add_control(
724 'counter_color',
725 [
726 'label' => esc_html__('Color', 'ultimate-post-kit'),
727 'type' => Controls_Manager::COLOR,
728 'selectors' => [
729 '{{WRAPPER}} .upk-static-social-count .upk-count .counter-value' => 'color: {{VALUE}}',
730 ],
731 ]
732 );
733 $this->add_group_control(
734 Group_Control_Typography::get_type(),
735 [
736 'name' => 'counter_typography',
737 'label' => esc_html__('Typography', 'ultimate-post-kit'),
738 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-count .counter-value',
739 ]
740 );
741 $this->add_responsive_control(
742 'social_counter_spacing',
743 [
744 'label' => esc_html__('Bottom Spacing', 'ultimate-post-kit'),
745 'type' => Controls_Manager::SLIDER,
746 'size_units' => ['px'],
747 'range' => [
748 'px' => [
749 'min' => 0,
750 'max' => 100,
751 'step' => 1,
752 ]
753 ],
754 'selectors' => [
755 '{{WRAPPER}} .upk-static-social-count .upk-count' => 'margin-bottom: {{SIZE}}{{UNIT}};',
756 ]
757 ]
758 );
759 $this->end_controls_section();
760
761 $this->start_controls_section(
762 'social_meta',
763 [
764 'label' => esc_html__('Meta', 'ultimate-post-kit'),
765 'tab' => Controls_Manager::TAB_STYLE,
766 ]
767 );
768 $this->add_control(
769 'meta_color',
770 [
771 'label' => esc_html__('Color', 'ultimate-post-kit'),
772 'type' => Controls_Manager::COLOR,
773 'selectors' => [
774 '{{WRAPPER}} .upk-static-social-count .upk-meta' => 'color: {{VALUE}}',
775 ],
776 ]
777 );
778 $this->add_group_control(
779 Group_Control_Typography::get_type(),
780 [
781 'name' => 'meta_typography',
782 'label' => esc_html__('Typography', 'ultimate-post-kit'),
783 'selector' => '{{WRAPPER}} .upk-static-social-count .upk-meta',
784 ]
785 );
786 $this->end_controls_section();
787 }
788
789 protected function render() {
790 $settings = $this->get_settings_for_display();
791 $this->add_render_attribute('upk-static-social-count', 'class', ['upk-static-social-count', $settings['select_style']], true);
792 $social_links = $this->get_settings('social_counter_list'); ?>
793 <div <?php $this->print_render_attribute_string('upk-static-social-count'); ?>>
794 <?php foreach ($social_links as $link_key => $social_link) {
795 $this->add_render_attribute($link_key, 'class', [
796 'upk-item',
797 'upk-social-icon',
798 'upk-social-icon-' . strtolower($social_link['social_site_name']),
799 'elementor-repeater-item-' . $social_link['_id'],
800 ]);
801 if ($social_link['social_site_link']['is_external'] !== 'on') {
802 $this->add_render_attribute($link_key, 'href', esc_url($social_link['social_site_link']['url']));
803 } else {
804 $this->add_render_attribute(
805 $link_key,
806 [
807 'href' => [
808 esc_url($social_link['social_site_link']['url'])
809 ],
810 'target' => '_blank'
811 ],
812 null,
813 true
814 );
815 }
816 ?>
817 <a <?php $this->print_render_attribute_string($link_key); ?>>
818 <div class="upk-icon">
819 <span title="<?php echo esc_html($social_link['social_site_name']); ?>">
820 <?php Icons_Manager::render_icon($social_link['social_site_icon'], ['aria-hidden' => 'true']); ?>
821 </span>
822 </div>
823 <div class="upk-content">
824 <div class="upk-count">
825 <?php echo '<span class="counter-value">' . esc_html($social_link['social_counter']) . '</span>'; ?>
826 </div>
827 <div class="upk-meta">
828 <?php printf('<span>%s</span>', esc_html($social_link['social_site_meta'])); ?>
829 </div>
830 </div>
831 </a>
832 <?php
833 }
834 echo '</div>';
835 }
836 }
837