PluginProbe
Elementor Website Builder – more than just a page builder / 3.25.4
Elementor Website Builder – more than just a page builder v3.25.4
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / link-in-bio / base / widget-link-in-bio-base.php

widget-link-in-bio-base.php in Elementor Website Builder – more than just a page builder 3.25.4, at modules/link-in-bio/base/widget-link-in-bio-base.php

1,752 lines 42.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\LinkInBio\Base;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Core\Base\Providers\Social_Network_Provider;
7 use Elementor\Core\Base\Traits\Shared_Widget_Controls_Trait;
8 use Elementor\Group_Control_Background;
9 use Elementor\Group_Control_Typography;
10 use Elementor\Modules\LinkInBio\Classes\Render\Core_Render;
11 use Elementor\Plugin;
12 use Elementor\Repeater;
13 use Elementor\Utils;
14 use Elementor\Widget_Base;
15
16 abstract class Widget_Link_In_Bio_Base extends Widget_Base {
17
18 use Shared_Widget_Controls_Trait;
19
20 public function get_group_name(): string {
21 return 'link-in-bio';
22 }
23
24 public function get_style_depends(): array {
25 $widget_name = $this->get_name();
26
27 $style_depends = Plugin::$instance->experiments->is_feature_active( 'e_font_icon_svg' )
28 ? parent::get_style_depends()
29 : [ 'elementor-icons-fa-solid', 'elementor-icons-fa-brands', 'elementor-icons-fa-regular' ];
30
31 $style_depends[] = 'widget-link-in-bio-base';
32
33 if ( 'link-in-bio' !== $widget_name ) {
34 $style_depends[] = "widget-{$widget_name}";
35 }
36
37 return $style_depends;
38 }
39
40 public static function get_configuration() {
41 return [
42 'content' => [
43 'identity_section' => [
44 'identity_image_style' => [
45 'default' => 'profile',
46 ],
47 'has_heading_text' => false,
48 'has_profile_image_controls' => false,
49 ],
50 'bio_section' => [
51 'title' => [
52 'default' => esc_html__( 'Kitchen Chronicles', 'elementor' ),
53 ],
54 'description' => [
55 'default' => esc_html__( 'Join me on my journey to a healthier lifestyle', 'elementor' ),
56 ],
57 'has_about_field' => false,
58 ],
59 'icon_section' => [
60 'has_text' => false,
61 'platform' => [
62 'group-1' => [
63 Social_Network_Provider::EMAIL,
64 Social_Network_Provider::TELEPHONE,
65 Social_Network_Provider::MESSENGER,
66 Social_Network_Provider::WAZE,
67 Social_Network_Provider::WHATSAPP,
68 ],
69 'limit' => 5,
70 ],
71 'default' => [
72 [
73 'icon_platform' => Social_Network_Provider::FACEBOOK,
74 ],
75 [
76 'icon_platform' => Social_Network_Provider::INSTAGRAM,
77 ],
78 [
79 'icon_platform' => Social_Network_Provider::TIKTOK,
80 ],
81 ],
82 ],
83 'cta_section' => [
84 'cta_max' => 0,
85 'cta_has_image' => false,
86 'cta_repeater_defaults' => [
87 [
88 'cta_link_text' => esc_html__( 'Get Healthy', 'elementor' ),
89 ],
90 [
91 'cta_link_text' => esc_html__( 'Top 10 Recipes', 'elementor' ),
92 ],
93 [
94 'cta_link_text' => esc_html__( 'Meal Prep', 'elementor' ),
95 ],
96 [
97 'cta_link_text' => esc_html__( 'Healthy Living Resources', 'elementor' ),
98 ],
99 ],
100 ],
101 'image_links_section' => false,
102 ],
103 'style' => [
104 'identity_section' => [
105 'has_profile_image_shape' => true,
106 'profile_image_max' => 115,
107 'cover_image_max' => 1000,
108 ],
109 'cta_section' => [
110 'has_dividers' => false,
111 'has_image_border' => false,
112 'has_link_type' => [
113 'default' => 'button',
114 ],
115 'has_corners' => [
116 'default' => 'rounded',
117 'options' => [
118 'round' => esc_html__( 'Round', 'elementor' ),
119 'rounded' => esc_html__( 'Rounded', 'elementor' ),
120 'sharp' => esc_html__( 'Sharp', 'elementor' ),
121 ],
122 ],
123 'has_padding' => true,
124 'has_background_control' => true,
125 'has_cta_control_text' => false,
126 'has_border_control' => [
127 'prefix' => 'cta_links',
128 'show_border_args' => [
129 'condition' => [
130 'cta_links_type' => 'button',
131 ],
132 ],
133 'border_width_args' => [
134 'condition' => [
135 'cta_links_type' => 'button',
136 ],
137 'selectors' => [
138 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-ctas-border-width: {{SIZE}}{{UNIT}}',
139 ],
140 ],
141 'border_color_args' => [
142 'condition' => [
143 'cta_links_type' => 'button',
144 ],
145 'selectors' => [
146 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-ctas-border-color: {{VALUE}}',
147 ],
148 ],
149 ],
150 ],
151 'border_section' => [
152 'field_options' => false,
153 'overlay_field_options' => false,
154 ],
155 'image_links_section' => false,
156 ],
157
158 ];
159 }
160
161 public function get_description_position() {
162 return 'top';
163 }
164
165 public function get_icon(): string {
166 return 'eicon-site-identity';
167 }
168
169 public function get_categories(): array {
170 return [ 'link-in-bio' ];
171 }
172
173 public function get_keywords(): array {
174 return [ 'buttons', 'bio', 'widget', 'link in bio' ];
175 }
176
177 public function get_image_position_options(): array {
178 return [
179 '' => esc_html__( 'Default', 'elementor' ),
180 'center center' => esc_html__( 'Center Center', 'elementor' ),
181 'center left' => esc_html__( 'Center Left', 'elementor' ),
182 'center right' => esc_html__( 'Center Right', 'elementor' ),
183 'top center' => esc_html__( 'Top Center', 'elementor' ),
184 'top left' => esc_html__( 'Top Left', 'elementor' ),
185 'top right' => esc_html__( 'Top Right', 'elementor' ),
186 'bottom center' => esc_html__( 'Bottom Center', 'elementor' ),
187 'bottom left' => esc_html__( 'Bottom Left', 'elementor' ),
188 'bottom right' => esc_html__( 'Bottom Right', 'elementor' ),
189 ];
190 }
191
192 protected function register_controls(): void {
193
194 $this->add_content_tab();
195
196 $this->add_style_tab();
197 }
198
199 protected function render(): void {
200 $render_strategy = new Core_Render( $this );
201
202 $render_strategy->render();
203 }
204
205 protected function add_image_links_controls() {
206 $config = static::get_configuration();
207
208 if ( empty( $config['content']['image_links_section'] ) ) {
209 return;
210 }
211
212 $this->start_controls_section(
213 'image_links_section',
214 [
215 'label' => esc_html__( 'Image Links', 'elementor' ),
216 'tab' => Controls_Manager::TAB_CONTENT,
217 ]
218 );
219
220 if ( ! empty( $config['content']['image_links_section']['images_max'] ) ) {
221 $this->add_control(
222 'image_links_alert',
223 [
224 'type' => Controls_Manager::ALERT,
225 'alert_type' => 'info',
226 'content' => sprintf(
227 __( 'Add up to <b>%d</b> Images', 'elementor' ),
228 $config['content']['image_links_section']['images_max']
229 ),
230 ]
231 );
232 }
233
234 $this->add_icons_per_row_control(
235 'image_links_per_row',
236 [
237 '1' => '1',
238 '2' => '2',
239 '3' => '3',
240 ],
241 '2',
242 esc_html__( 'Images Per Row', 'elementor' ),
243 '--e-link-in-bio-image-links-columns',
244 );
245
246 $repeater = new Repeater();
247
248 $repeater->add_control(
249 'image_links_image',
250 [
251 'label' => esc_html__( 'Choose Image', 'elementor' ),
252 'type' => Controls_Manager::MEDIA,
253 'label_block' => true,
254 'default' => [
255 'url' => Utils::get_placeholder_image_src(),
256 ],
257 ]
258 );
259
260 $repeater->add_control(
261 'image_links_url',
262 [
263 'label' => esc_html__( 'Link', 'elementor' ),
264 'type' => Controls_Manager::URL,
265 'dynamic' => [
266 'active' => true,
267 ],
268 'autocomplete' => true,
269 'label_block' => true,
270 'placeholder' => esc_html__( 'Paste URL or type', 'elementor' ),
271 'default' => [
272 'is_external' => true,
273 ],
274 ],
275 );
276
277 $this->add_control(
278 'image_links',
279 [
280 'type' => Controls_Manager::REPEATER,
281 'max_items' => $config['content']['image_links_section']['images_max'] ?? 0,
282 'fields' => $repeater->get_controls(),
283 'prevent_empty' => true,
284 'button_text' => esc_html__( 'Add item', 'elementor' ),
285 'default' => $config['content']['image_links_section']['images_repeater_defaults'] ?? [],
286 ]
287 );
288
289 $this->end_controls_section();
290 }
291
292 protected function add_cta_controls() {
293 $config = static::get_configuration();
294
295 if ( empty( $config['content']['cta_section'] ) ) {
296 return;
297 }
298
299 $this->start_controls_section(
300 'cta_section',
301 [
302 'label' => esc_html__( 'CTA Link Buttons', 'elementor' ),
303 'tab' => Controls_Manager::TAB_CONTENT,
304 ]
305 );
306
307 if ( ! empty( $config['content']['cta_section']['cta_max'] ) ) {
308 $this->add_control(
309 'cta_section_alert',
310 [
311 'type' => Controls_Manager::ALERT,
312 'alert_type' => 'info',
313 'content' => sprintf(
314 __( 'Add up to <b>%d</b> CTA links', 'elementor' ),
315 $config['content']['cta_section']['cta_max']
316 ),
317 ]
318 );
319 }
320
321 $repeater = new Repeater();
322
323 $repeater->add_control(
324 'cta_link_text',
325 [
326 'label' => esc_html__( 'Text', 'elementor' ),
327 'type' => Controls_Manager::TEXT,
328 'dynamic' => [
329 'active' => true,
330 ],
331 'label_block' => true,
332 'default' => esc_html__( 'CTA link', 'elementor' ),
333 'placeholder' => esc_html__( 'Enter link text', 'elementor' ),
334 ],
335 );
336
337 if ( $config['content']['cta_section']['cta_has_image'] ) {
338 $repeater->add_control(
339 'cta_link_image',
340 [
341 'label' => esc_html__( 'Choose Image', 'elementor' ),
342 'type' => Controls_Manager::MEDIA,
343 'label_block' => true,
344 'default' => [
345 'url' => Utils::get_placeholder_image_src(),
346 ],
347 ]
348 );
349 }
350
351 $repeater->add_control(
352 'cta_link_type',
353 [
354 'label' => esc_html__( 'Link Type', 'elementor' ),
355 'type' => Controls_Manager::SELECT,
356 'groups' => [
357
358 [
359 'label' => '',
360 'options' => Social_Network_Provider::get_social_networks_text(
361 [
362 Social_Network_Provider::URL,
363 Social_Network_Provider::FILE_DOWNLOAD,
364 ]
365 ),
366 ],
367 [
368 'label' => ' --',
369 'options' => Social_Network_Provider::get_social_networks_text(
370 [
371 Social_Network_Provider::EMAIL,
372 Social_Network_Provider::TELEPHONE,
373 Social_Network_Provider::MESSENGER,
374 Social_Network_Provider::WAZE,
375 Social_Network_Provider::WHATSAPP,
376 ]
377 ),
378 ],
379 ],
380 'default' => Social_Network_Provider::URL,
381 ],
382 );
383
384 $repeater->add_control(
385 'cta_link_file',
386 [
387 'label' => esc_html__( 'Choose File', 'elementor' ),
388 'type' => Controls_Manager::MEDIA,
389 'label_block' => true,
390 'media_type' => [ 'application/pdf' ],
391 'condition' => [
392 'cta_link_type' => [
393 Social_Network_Provider::FILE_DOWNLOAD,
394 ],
395 ],
396 'ai' => [
397 'active' => false,
398 ],
399 ],
400 );
401
402 $repeater->add_control(
403 'cta_link_url',
404 [
405 'label' => esc_html__( 'Link', 'elementor' ),
406 'type' => Controls_Manager::URL,
407 'dynamic' => [
408 'active' => true,
409 ],
410 'autocomplete' => true,
411 'label_block' => true,
412 'condition' => [
413 'cta_link_type' => [
414 Social_Network_Provider::URL,
415 ],
416 ],
417 'placeholder' => esc_html__( 'Enter your link', 'elementor' ),
418 'default' => [
419 'is_external' => true,
420 ],
421 ],
422 );
423
424 $repeater->add_control(
425 'cta_link_mail',
426 [
427 'label' => esc_html__( 'Mail', 'elementor' ),
428 'type' => Controls_Manager::TEXT,
429 'dynamic' => [
430 'active' => true,
431 ],
432 'label_block' => true,
433 'condition' => [
434 'cta_link_type' => [
435 Social_Network_Provider::EMAIL,
436 ],
437 ],
438 'placeholder' => esc_html__( 'Enter your email', 'elementor' ),
439 ],
440 );
441
442 $repeater->add_control(
443 'cta_link_mail_subject',
444 [
445 'label' => esc_html__( 'Subject', 'elementor' ),
446 'type' => Controls_Manager::TEXT,
447 'dynamic' => [
448 'active' => true,
449 ],
450 'label_block' => true,
451 'condition' => [
452 'cta_link_type' => [
453 Social_Network_Provider::EMAIL,
454 ],
455 ],
456 'placeholder' => esc_html__( 'Subject', 'elementor' ),
457 ],
458 );
459
460 $repeater->add_control(
461 'cta_link_mail_body',
462 [
463 'label' => esc_html__( 'Message', 'elementor' ),
464 'type' => Controls_Manager::TEXTAREA,
465 'dynamic' => [
466 'active' => true,
467 ],
468 'label_block' => true,
469 'condition' => [
470 'cta_link_type' => [
471 Social_Network_Provider::EMAIL,
472 ],
473 ],
474 'placeholder' => esc_html__( 'Message', 'elementor' ),
475 ],
476 );
477
478 $repeater->add_control(
479 'cta_link_number',
480 [
481 'label' => esc_html__( 'Number', 'elementor' ),
482 'type' => Controls_Manager::TEXT,
483 'dynamic' => [
484 'active' => true,
485 ],
486 'label_block' => true,
487 'condition' => [
488 'cta_link_type' => [
489 Social_Network_Provider::TELEPHONE,
490 Social_Network_Provider::WHATSAPP,
491 ],
492 ],
493 'placeholder' => esc_html__( 'Enter your number', 'elementor' ),
494 ],
495 );
496
497 $repeater->add_control(
498 'cta_link_location',
499 [
500 'label' => esc_html__( 'Location', 'elementor' ),
501 'type' => Controls_Manager::URL,
502 'dynamic' => [
503 'active' => true,
504 ],
505 'default' => [
506 'is_external' => true,
507 ],
508 'label_block' => true,
509 'condition' => [
510 'cta_link_type' => [
511 Social_Network_Provider::WAZE,
512 ],
513 ],
514 'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ),
515 ],
516 );
517
518 $repeater->add_control(
519 'cta_link_username',
520 [
521 'label' => esc_html__( 'Username', 'elementor' ),
522 'type' => Controls_Manager::TEXT,
523 'dynamic' => [
524 'active' => true,
525 ],
526 'label_block' => true,
527 'condition' => [
528 'cta_link_type' => [
529 Social_Network_Provider::MESSENGER,
530 ],
531 ],
532 'placeholder' => esc_html__( 'Enter your username', 'elementor' ),
533 ],
534 );
535
536 $this->add_control(
537 'cta_link',
538 [
539 'type' => Controls_Manager::REPEATER,
540 'max_items' => $config['content']['cta_section']['cta_max'] ?? 0,
541 'fields' => $repeater->get_controls(),
542 'title_field' => '{{{ cta_link_text }}}',
543 'button_text' => esc_html__( 'Add CTA Link', 'elementor' ),
544 'default' => $config['content']['cta_section']['cta_repeater_defaults'],
545 ]
546 );
547
548 $this->end_controls_section();
549 }
550
551 protected function add_icons_controls(): void {
552 $config = static::get_configuration();
553
554 $this->start_controls_section(
555 'icons_section',
556 [
557 'label' => esc_html__( 'Icons', 'elementor' ),
558 'tab' => Controls_Manager::TAB_CONTENT,
559 ]
560 );
561
562 if ( $config['content']['icon_section']['platform']['limit'] ) {
563 $this->add_control(
564 'custom_panel_alert',
565 [
566 'type' => Controls_Manager::ALERT,
567 'alert_type' => 'info',
568 'content' => sprintf(
569 __( 'Add up to <b>%d</b> icons', 'elementor' ),
570 $config['content']['icon_section']['platform']['limit']
571 ),
572 ]
573 );
574 }
575
576 $repeater = new Repeater();
577
578 if ( $config['content']['icon_section']['has_text'] ) {
579 $repeater->add_control(
580 'icon_text',
581 [
582 'label' => esc_html__( 'Text', 'elementor' ),
583 'type' => Controls_Manager::TEXT,
584 'dynamic' => [
585 'active' => true,
586 ],
587 'placeholder' => esc_html__( 'Enter icon text', 'elementor' ),
588 ],
589 );
590 }
591
592 $repeater->add_control(
593 'icon_platform',
594 [
595 'label' => esc_html__( 'Platform', 'elementor' ),
596 'type' => Controls_Manager::SELECT,
597 'groups' => [
598
599 [
600 'label' => '',
601 'options' => Social_Network_Provider::get_social_networks_text(
602 $config['content']['icon_section']['platform']['group-1']
603 ),
604 ],
605 [
606 'label' => ' --',
607 'options' => Social_Network_Provider::get_social_networks_text(
608 [
609 Social_Network_Provider::FACEBOOK,
610 Social_Network_Provider::INSTAGRAM,
611 Social_Network_Provider::LINKEDIN,
612 Social_Network_Provider::PINTEREST,
613 Social_Network_Provider::TIKTOK,
614 Social_Network_Provider::TWITTER,
615 Social_Network_Provider::YOUTUBE,
616 ]
617 ),
618 ],
619 [
620 'label' => ' --',
621 'options' => Social_Network_Provider::get_social_networks_text(
622 [
623 Social_Network_Provider::APPLEMUSIC,
624 Social_Network_Provider::BEHANCE,
625 Social_Network_Provider::DRIBBBLE,
626 Social_Network_Provider::SPOTIFY,
627 Social_Network_Provider::SOUNDCLOUD,
628 Social_Network_Provider::VIMEO,
629 ]
630 ),
631 ],
632 ],
633 'default' => Social_Network_Provider::FACEBOOK,
634 ],
635 );
636
637 $repeater->add_control(
638 'icon_url',
639 [
640 'label' => esc_html__( 'Link', 'elementor' ),
641 'type' => Controls_Manager::URL,
642 'dynamic' => [
643 'active' => true,
644 ],
645 'autocomplete' => true,
646 'label_block' => true,
647 'placeholder' => esc_html__( 'Enter your link', 'elementor' ),
648 'default' => [
649 'is_external' => true,
650 ],
651 'condition' => [
652 'icon_platform' => [
653 Social_Network_Provider::VIMEO,
654 Social_Network_Provider::FACEBOOK,
655 Social_Network_Provider::SOUNDCLOUD,
656 Social_Network_Provider::SPOTIFY,
657 Social_Network_Provider::INSTAGRAM,
658 Social_Network_Provider::LINKEDIN,
659 Social_Network_Provider::PINTEREST,
660 Social_Network_Provider::TIKTOK,
661 Social_Network_Provider::TWITTER,
662 Social_Network_Provider::YOUTUBE,
663 Social_Network_Provider::APPLEMUSIC,
664 Social_Network_Provider::BEHANCE,
665 Social_Network_Provider::DRIBBBLE,
666 Social_Network_Provider::SPOTIFY,
667 Social_Network_Provider::SOUNDCLOUD,
668 Social_Network_Provider::URL,
669 ],
670 ],
671 ],
672 );
673
674 $repeater->add_control(
675 'icon_mail',
676 [
677 'label' => esc_html__( 'Email', 'elementor' ),
678 'type' => Controls_Manager::TEXT,
679 'placeholder' => esc_html__( 'Enter your email', 'elementor' ),
680 'dynamic' => [
681 'active' => true,
682 ],
683 'label_block' => true,
684 'condition' => [
685 'icon_platform' => [
686 Social_Network_Provider::EMAIL,
687 ],
688 ],
689 'ai' => [
690 'active' => false,
691 ],
692 ]
693 );
694
695 $repeater->add_control(
696 'icon_mail_subject',
697 [
698 'label' => esc_html__( 'Subject', 'elementor' ),
699 'type' => Controls_Manager::TEXT,
700 'placeholder' => esc_html__( 'Subject', 'elementor' ),
701 'label_block' => true,
702 'condition' => [
703 'icon_platform' => [
704 Social_Network_Provider::EMAIL,
705 ],
706 ],
707 ]
708 );
709
710 $repeater->add_control(
711 'icon_mail_body',
712 [
713 'label' => esc_html__( 'Message', 'elementor' ),
714 'type' => Controls_Manager::TEXTAREA,
715 'placeholder' => esc_html__( 'Message', 'elementor' ),
716 'label_block' => true,
717 'condition' => [
718 'icon_platform' => [
719 Social_Network_Provider::EMAIL,
720 ],
721 ],
722 ]
723 );
724
725 $repeater->add_control(
726 'icon_number',
727 [
728 'label' => esc_html__( 'Number', 'elementor' ),
729 'type' => Controls_Manager::TEXT,
730 'dynamic' => [
731 'active' => true,
732 ],
733 'label_block' => true,
734 'placeholder' => esc_html__( '+', 'elementor' ),
735 'condition' => [
736 'icon_platform' => [
737 Social_Network_Provider::TELEPHONE,
738 Social_Network_Provider::WHATSAPP,
739 ],
740 ],
741 'ai' => [
742 'active' => false,
743 ],
744 ],
745 );
746
747 $repeater->add_control(
748 'icon_location',
749 [
750 'label' => esc_html__( 'Location', 'elementor' ),
751 'type' => Controls_Manager::URL,
752 'dynamic' => [
753 'active' => true,
754 ],
755 'default' => [
756 'is_external' => true,
757 ],
758 'label_block' => true,
759 'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ),
760 'condition' => [
761 'icon_platform' => [
762 Social_Network_Provider::WAZE,
763 ],
764 ],
765 'ai' => [
766 'active' => false,
767 ],
768 ],
769 );
770
771 $repeater->add_control(
772 'icon_username',
773 [
774 'label' => esc_html__( 'Username', 'elementor' ),
775 'type' => Controls_Manager::TEXT,
776 'dynamic' => [
777 'active' => true,
778 ],
779 'label_block' => true,
780 'placeholder' => esc_html__( 'Enter your username', 'elementor' ),
781 'condition' => [
782 'icon_platform' => [
783 Social_Network_Provider::MESSENGER,
784 ],
785 ],
786 ],
787 );
788
789 $this->add_control(
790 'icon',
791 [
792 'max_items' => $config['content']['icon_section']['platform']['limit'],
793 'type' => Controls_Manager::REPEATER,
794 'fields' => $repeater->get_controls(),
795 'title_field' => $this->get_icon_title_field(),
796 'prevent_empty' => true,
797 'button_text' => esc_html__( 'Add Icon', 'elementor' ),
798 'default' => $config['content']['icon_section']['default'],
799 ]
800 );
801
802 $this->end_controls_section();
803 }
804
805 protected function get_icon_title_field(): string {
806 $platform_icons_js = json_encode( Social_Network_Provider::get_social_networks_icons() );
807
808 return <<<JS
809 <#
810 elementor.helpers.enqueueIconFonts( 'fa-solid' );
811 elementor.helpers.enqueueIconFonts( 'fa-brands' );
812 const mapping = {$platform_icons_js};
813 #>
814 <i class='{{{ mapping[icon_platform] }}}' ></i> {{{ icon_platform }}}
815 JS;
816 }
817
818 protected function add_style_tab(): void {
819
820 $this->add_style_identity_controls();
821
822 $this->add_style_bio_controls();
823
824 $this->add_style_icons_controls();
825
826 $this->add_style_cta_section();
827
828 $this->add_style_image_links_controls();
829
830 $this->add_style_background_controls();
831 }
832
833 protected function add_bio_section(): void {
834 $config = static::get_configuration();
835 $this->start_controls_section(
836 'bio_section',
837 [
838 'label' => esc_html__( 'Bio', 'elementor' ),
839 'tab' => Controls_Manager::TAB_CONTENT,
840 ]
841 );
842
843 $this->add_control(
844 'bio_heading',
845 [
846 'label' => esc_html__( 'Heading', 'elementor' ),
847 'type' => Controls_Manager::TEXTAREA,
848 'dynamic' => [
849 'active' => true,
850 ],
851 'placeholder' => esc_html__( 'Heading', 'elementor' ),
852 'default' => esc_html__( 'Sara Parker', 'elementor' ),
853 ]
854 );
855
856 $this->add_html_tag_control( 'bio_heading_tag', 'h2' );
857
858 $this->add_control(
859 'bio_title',
860 [
861 'label' => esc_html__( 'Title or Tagline', 'elementor' ),
862 'type' => Controls_Manager::TEXTAREA,
863 'dynamic' => [
864 'active' => true,
865 ],
866 'placeholder' => esc_html__( 'Title', 'elementor' ),
867 'default' => $config['content']['bio_section']['title']['default'],
868 ]
869 );
870
871 $this->add_html_tag_control( 'bio_title_tag', 'h3' );
872
873 if ( $config['content']['bio_section']['has_about_field'] ) {
874 $this->add_control(
875 'bio_about',
876 [
877 'label' => esc_html__( 'About Heading', 'elementor' ),
878 'type' => Controls_Manager::TEXTAREA,
879 'dynamic' => [
880 'active' => true,
881 ],
882 'placeholder' => esc_html__( 'About', 'elementor' ),
883 'default' => esc_html__( 'About Me', 'elementor' ),
884 ]
885 );
886 $this->add_html_tag_control( 'bio_about_tag', 'h3' );
887 }
888
889 $this->add_control(
890 'bio_description',
891 [
892 'label' => esc_html__( 'Description', 'elementor' ),
893 'type' => Controls_Manager::TEXTAREA,
894 'dynamic' => [
895 'active' => true,
896 ],
897 'placeholder' => esc_html__( 'Description', 'elementor' ),
898 'default' => $config['content']['bio_section']['description']['default'],
899 ]
900 );
901
902 $this->end_controls_section();
903 }
904
905 protected function add_identity_section(): void {
906 $config = static::get_configuration();
907
908 $this->start_controls_section(
909 'identity_section',
910 [
911 'label' => esc_html__( 'Identity', 'elementor' ),
912 'tab' => Controls_Manager::TAB_CONTENT,
913 ]
914 );
915
916 if ( $config['content']['identity_section']['has_profile_image_controls'] ) {
917 $this->add_control(
918 'identity_heading_cover',
919 [
920 'label' => esc_html__( 'Cover', 'elementor' ),
921 'type' => Controls_Manager::HEADING,
922 'separator' => 'before',
923 ]
924 );
925
926 $this->add_control(
927 'identity_image_cover',
928 [
929 'label' => esc_html__( 'Choose Image', 'elementor' ),
930 'type' => Controls_Manager::MEDIA,
931 'default' => [
932 'url' => Utils::get_placeholder_image_src(),
933 ],
934 ]
935 );
936
937 $this->add_responsive_control(
938 'identity_image_cover_position',
939 [
940 'label' => esc_html__( 'Position', 'elementor' ),
941 'type' => Controls_Manager::SELECT,
942 'desktop_default' => 'center center',
943 'tablet_default' => 'center center',
944 'mobile_default' => 'center center',
945 'options' => $this->get_image_position_options(),
946 'selectors' => [
947 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-identity-image-cover-position: {{VALUE}}',
948 ],
949 'condition' => [
950 'identity_image_cover[url]!' => '',
951 ],
952 ]
953 );
954 }
955
956 if ( $config['content']['identity_section']['has_heading_text'] ) {
957 $this->add_control(
958 'identity_heading',
959 [
960 'label' => $config['content']['identity_section']['has_heading_text'],
961 'type' => Controls_Manager::HEADING,
962 ]
963 );
964 }
965
966 if ( $config['content']['identity_section']['identity_image_style'] ) {
967 $this->add_control(
968 'identity_image_style',
969 [
970 'label' => esc_html__( 'Image style', 'elementor' ),
971 'type' => Controls_Manager::SELECT,
972 'default' => $config['content']['identity_section']['identity_image_style']['default'],
973 'options' => [
974 'profile' => esc_html__( 'Profile', 'elementor' ),
975 'cover' => esc_html__( 'Cover', 'elementor' ),
976 ],
977 ]
978 );
979 }
980
981 $this->add_control(
982 'identity_image',
983 [
984 'label' => esc_html__( 'Choose Image', 'elementor' ),
985 'type' => Controls_Manager::MEDIA,
986 'default' => [
987 'url' => Utils::get_placeholder_image_src(),
988 ],
989 ]
990 );
991
992 $this->add_responsive_control(
993 'identity_image_position',
994 [
995 'label' => esc_html__( 'Position', 'elementor' ),
996 'type' => Controls_Manager::SELECT,
997 'desktop_default' => 'center center',
998 'tablet_default' => 'center center',
999 'mobile_default' => 'center center',
1000 'options' => $this->get_image_position_options(),
1001 'selectors' => [
1002 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-identity-image-profile-position: {{VALUE}}',
1003 ],
1004 'condition' => [
1005 'identity_image[url]!' => '',
1006 ],
1007 ]
1008 );
1009
1010 $this->end_controls_section();
1011 }
1012
1013 protected function add_style_image_links_controls(): void {
1014 $config = static::get_configuration();
1015
1016 if ( empty( $config['style']['image_links_section'] ) ) {
1017 return;
1018 }
1019
1020 $this->start_controls_section(
1021 'image_links_section_style',
1022 [
1023 'label' => esc_html__( 'Image Links', 'elementor' ),
1024 'tab' => Controls_Manager::TAB_STYLE,
1025 ]
1026 );
1027
1028 $this->add_responsive_control(
1029 'image_links_height',
1030 [
1031 'label' => esc_html__( 'Image Height', 'elementor' ) . ' (px)',
1032 'type' => Controls_Manager::SLIDER,
1033 'size_units' => [ 'px' ],
1034 'range' => [
1035 'px' => [
1036 'min' => 0,
1037 'max' => 300,
1038 'step' => 1,
1039 ],
1040 ],
1041 'default' => [
1042 'unit' => 'px',
1043 ],
1044 'selectors' => [
1045 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-image-links-height: {{SIZE}}{{UNIT}}',
1046 ],
1047 ]
1048 );
1049
1050 if ( $config['style']['image_links_section']['has_border_control'] ) {
1051 $this->add_borders_control(
1052 $config['style']['image_links_section']['has_border_control']['prefix'],
1053 $config['style']['image_links_section']['has_border_control']['show_border_args'],
1054 $config['style']['image_links_section']['has_border_control']['border_width_args'],
1055 $config['style']['image_links_section']['has_border_control']['border_color_args'],
1056 );
1057 }
1058
1059 $this->end_controls_section();
1060 }
1061
1062 protected function add_style_cta_section(): void {
1063 $config = static::get_configuration();
1064
1065 if ( empty( $config['style']['cta_section'] ) ) {
1066 return;
1067 }
1068
1069 $this->start_controls_section(
1070 'cta_links_section_style',
1071 [
1072 'label' => esc_html__( 'CTA Link Buttons', 'elementor' ),
1073 'tab' => Controls_Manager::TAB_STYLE,
1074 ]
1075 );
1076
1077 if ( $config['style']['cta_section']['has_cta_control_text'] ) {
1078 $this->add_control(
1079 'cta_links_heading',
1080 [
1081 'label' => $config['style']['cta_section']['has_cta_control_text'],
1082 'type' => Controls_Manager::HEADING,
1083 ]
1084 );
1085 }
1086
1087 if ( $config['style']['cta_section']['has_link_type'] ) {
1088 $this->add_control(
1089 'cta_links_type',
1090 [
1091 'label' => esc_html__( 'Type', 'elementor' ),
1092 'type' => Controls_Manager::SELECT,
1093 'default' => $config['style']['cta_section']['has_link_type']['default'],
1094 'options' => [
1095 'button' => esc_html__( 'Button', 'elementor' ),
1096 'link' => esc_html__( 'Link', 'elementor' ),
1097 ],
1098 ]
1099 );
1100 }
1101
1102 $this->add_control(
1103 'cta_links_text_color',
1104 [
1105 'label' => esc_html__( 'Text Color', 'elementor' ),
1106 'type' => Controls_Manager::COLOR,
1107 'selectors' => [
1108 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-ctas-text-color: {{VALUE}}',
1109 '{{WRAPPER}} .e-link-in-bio__cta.is-type-link' => '--e-link-in-bio-ctas-text-color: {{VALUE}}',
1110 ],
1111 ]
1112 );
1113
1114 $condition_if_has_links = [];
1115 if ( $config['style']['cta_section']['has_link_type'] ) {
1116 $condition_if_has_links = [
1117 'cta_links_type' => 'button',
1118 ];
1119 }
1120
1121 if ( $config['style']['cta_section']['has_background_control'] ) {
1122 $this->add_control(
1123 'cta_links_background_color',
1124 [
1125 'label' => esc_html__( 'Background Color', 'elementor' ),
1126 'type' => Controls_Manager::COLOR,
1127 'condition' => $condition_if_has_links,
1128 'selectors' => [
1129 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-ctas-background-color: {{VALUE}}',
1130 ],
1131 ]
1132 );
1133 }
1134
1135 $this->add_group_control(
1136 Group_Control_Typography::get_type(),
1137 [
1138 'name' => 'cta_links_typography',
1139 'selector' => '{{WRAPPER}} .e-link-in-bio__cta',
1140 ]
1141 );
1142
1143 if ( $config['style']['cta_section']['has_border_control'] ) {
1144 $this->add_borders_control(
1145 $config['style']['cta_section']['has_border_control']['prefix'],
1146 $config['style']['cta_section']['has_border_control']['show_border_args'],
1147 $config['style']['cta_section']['has_border_control']['border_width_args'],
1148 $config['style']['cta_section']['has_border_control']['border_color_args'],
1149 );
1150 }
1151
1152 if ( $config['style']['cta_section']['has_corners'] ) {
1153 $this->add_control(
1154 'cta_links_corners',
1155 [
1156 'label' => esc_html__( 'Corners', 'elementor' ),
1157 'type' => Controls_Manager::SELECT,
1158 'default' => $config['style']['cta_section']['has_corners']['default'],
1159 'options' => $config['style']['cta_section']['has_corners']['options'],
1160 'condition' => $condition_if_has_links,
1161 ]
1162 );
1163 }
1164
1165 if ( $config['style']['cta_section']['has_padding'] ) {
1166 $this->add_control(
1167 'cta_links_hr',
1168 [
1169 'type' => Controls_Manager::DIVIDER,
1170 ]
1171 );
1172
1173 $this->add_responsive_control(
1174 'cta_links_padding',
1175 [
1176 'label' => esc_html__( 'Padding', 'elementor' ),
1177 'type' => Controls_Manager::DIMENSIONS,
1178 'size_units' => [ 'px', '%', 'em', 'rem' ],
1179 'default' => [
1180 'unit' => 'px',
1181 'isLinked' => false,
1182 ],
1183 'condition' => $condition_if_has_links,
1184 'selectors' => [
1185 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-ctas-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-link-in-bio-ctas-padding-block-start: {{TOP}}{{UNIT}}; --e-link-in-bio-ctas-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-link-in-bio-ctas-padding-inline-start: {{LEFT}}{{UNIT}};',
1186 ],
1187 ]
1188 );
1189 }
1190
1191 if ( $config['style']['cta_section']['has_dividers'] ) {
1192 $this->add_control(
1193 'cta_links_hr',
1194 [
1195 'type' => Controls_Manager::HEADING,
1196 'label' => esc_html__( 'Dividers', 'elementor' ),
1197 'separator' => 'before',
1198 ]
1199 );
1200
1201 $this->add_control(
1202 'cta_links_divider_color',
1203 [
1204 'label' => esc_html__( 'Color', 'elementor' ),
1205 'type' => Controls_Manager::COLOR,
1206 'selectors' => [
1207 '{{WRAPPER}} .e-link-in-bio__cta' => 'border-bottom-color: {{VALUE}}',
1208 ],
1209 ]
1210 );
1211
1212 $this->add_control(
1213 'cta_links_divider_width',
1214 [
1215 'label' => esc_html__( 'Weight', 'elementor' ) . ' (px)',
1216 'type' => Controls_Manager::SLIDER,
1217 'size_units' => [ 'px' ],
1218 'range' => [
1219 'px' => [
1220 'min' => 0,
1221 'max' => 10,
1222 'step' => 1,
1223 ],
1224 ],
1225 'default' => [
1226 'unit' => 'px',
1227 ],
1228 'selectors' => [
1229 '{{WRAPPER}} .e-link-in-bio__cta' => 'border-bottom-width: {{SIZE}}{{UNIT}}',
1230 ],
1231 ]
1232 );
1233 }
1234
1235 $this->end_controls_section();
1236 }
1237
1238 protected function add_style_identity_controls(): void {
1239 $config = static::get_configuration();
1240
1241 $this->start_controls_section(
1242 'identity_section_style',
1243 [
1244 'label' => esc_html__( 'Identity', 'elementor' ),
1245 'tab' => Controls_Manager::TAB_STYLE,
1246 ]
1247 );
1248
1249 $condition = [];
1250 if ( $config['content']['identity_section']['identity_image_style'] ) {
1251 $condition = [
1252 'identity_image_style' => 'profile',
1253 ];
1254 }
1255
1256 $this->add_identity_image_profile_controls( $condition );
1257
1258 $condition = [
1259 'identity_image_style' => 'cover',
1260 ];
1261
1262 $this->add_identity_image_cover_control( $condition );
1263
1264 $this->end_controls_section();
1265 }
1266
1267 protected function add_content_tab(): void {
1268
1269 $this->add_identity_section();
1270
1271 $this->add_bio_section();
1272
1273 $this->add_icons_controls();
1274
1275 $this->add_cta_controls();
1276
1277 $this->add_image_links_controls();
1278 }
1279
1280 protected function add_style_bio_controls(): void {
1281 $this->start_controls_section(
1282 'bio_section_style',
1283 [
1284 'label' => esc_html__( 'Bio', 'elementor' ),
1285 'tab' => Controls_Manager::TAB_STYLE,
1286 ]
1287 );
1288
1289 $this->add_control(
1290 'bio_heading_heading',
1291 [
1292 'label' => esc_html__( 'Heading', 'elementor' ),
1293 'type' => Controls_Manager::HEADING,
1294 'separator' => 'before',
1295 ]
1296 );
1297
1298 $this->add_control(
1299 'bio_heading_text_color',
1300 [
1301 'label' => esc_html__( 'Text Color', 'elementor' ),
1302 'type' => Controls_Manager::COLOR,
1303 'selectors' => [
1304 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-heading-color: {{VALUE}}',
1305 ],
1306 ]
1307 );
1308
1309 $this->add_group_control(
1310 Group_Control_Typography::get_type(),
1311 [
1312 'name' => 'bio_heading_typography',
1313 'selector' => '{{WRAPPER}} .e-link-in-bio__heading',
1314 ]
1315 );
1316
1317 $this->add_control(
1318 'bio_title_heading',
1319 [
1320 'label' => esc_html__( 'Title or Tagline', 'elementor' ),
1321 'type' => Controls_Manager::HEADING,
1322 'separator' => 'before',
1323 ]
1324 );
1325
1326 $this->add_control(
1327 'bio_title_text_color',
1328 [
1329 'label' => esc_html__( 'Text Color', 'elementor' ),
1330 'type' => Controls_Manager::COLOR,
1331 'selectors' => [
1332 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-title-color: {{VALUE}}',
1333 ],
1334 ]
1335 );
1336
1337 $this->add_group_control(
1338 Group_Control_Typography::get_type(),
1339 [
1340 'name' => 'bio_title_typography',
1341 'selector' => '{{WRAPPER}} .e-link-in-bio__title',
1342 ]
1343 );
1344
1345 $this->add_control(
1346 'bio_description_heading',
1347 [
1348 'label' => esc_html__( 'Description', 'elementor' ),
1349 'type' => Controls_Manager::HEADING,
1350 'separator' => 'before',
1351 ]
1352 );
1353
1354 $this->add_control(
1355 'bio_description_text_color',
1356 [
1357 'label' => esc_html__( 'Text Color', 'elementor' ),
1358 'type' => Controls_Manager::COLOR,
1359 'selectors' => [
1360 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-description-color: {{VALUE}}',
1361 ],
1362 ]
1363 );
1364
1365 $this->add_group_control(
1366 Group_Control_Typography::get_type(),
1367 [
1368 'name' => 'bio_description_typography',
1369 'selector' => '{{WRAPPER}} .e-link-in-bio__description',
1370 ]
1371 );
1372
1373 $this->end_controls_section();
1374 }
1375
1376 protected function add_style_icons_controls(): void {
1377
1378 $this->start_controls_section(
1379 'icons_section_style',
1380 [
1381 'label' => esc_html__( 'Icons', 'elementor' ),
1382 'tab' => Controls_Manager::TAB_STYLE,
1383 ]
1384 );
1385
1386 $this->add_control(
1387 'icons_color',
1388 [
1389 'label' => esc_html__( 'Color', 'elementor' ),
1390 'type' => Controls_Manager::COLOR,
1391 'selectors' => [
1392 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-icon-color: {{VALUE}}',
1393 ],
1394 ]
1395 );
1396
1397 $this->add_control(
1398 'icons_size',
1399 [
1400 'label' => esc_html__( 'Size', 'elementor' ),
1401 'type' => Controls_Manager::SELECT,
1402 'default' => 'small',
1403 'options' => [
1404 'small' => esc_html__( 'Small', 'elementor' ),
1405 'medium' => esc_html__( 'Medium', 'elementor' ),
1406 'large' => esc_html__( 'Large', 'elementor' ),
1407 ],
1408 ]
1409 );
1410
1411 $this->end_controls_section();
1412 }
1413
1414 protected function add_style_background_controls(): void {
1415 $config = static::get_configuration();
1416
1417 // Defaults for background image and overlay
1418 $bg_section_image_field_option_defaults = [
1419 'background' => [
1420 'default' => 'classic',
1421 ],
1422 'position' => [
1423 'default' => 'center center',
1424 ],
1425 'size' => [
1426 'default' => 'cover',
1427 ],
1428 ];
1429
1430 // Background image
1431 $bg_image_field_options = $bg_section_image_field_option_defaults;
1432
1433 if ( $config['style']['border_section']['field_options'] ) {
1434 $bg_image_field_options = array_merge(
1435 $bg_section_image_field_option_defaults,
1436 $config['style']['border_section']['field_options']
1437 );
1438 }
1439
1440 // Background overlay
1441 $bg_overlay_image_field_options = $bg_section_image_field_option_defaults;
1442
1443 if ( $config['style']['border_section']['overlay_field_options'] ) {
1444 $bg_overlay_image_field_options = array_merge(
1445 $bg_section_image_field_option_defaults,
1446 $config['style']['border_section']['overlay_field_options']
1447 );
1448 }
1449
1450 $this->start_controls_section(
1451 'background_border_section_style',
1452 [
1453 'label' => esc_html__( 'Box', 'elementor' ),
1454 'tab' => Controls_Manager::TAB_STYLE,
1455 ]
1456 );
1457
1458 $this->add_control(
1459 'background_border_background',
1460 [
1461 'label' => esc_html__( 'Background', 'elementor' ),
1462 'type' => Controls_Manager::HEADING,
1463 'separator' => 'before',
1464 ]
1465 );
1466
1467 $this->add_group_control(
1468 Group_Control_Background::get_type(),
1469 [
1470 'name' => 'background_border_background_group',
1471 'types' => [ 'classic', 'gradient' ],
1472 'selector' => '{{WRAPPER}} .e-link-in-bio__bg',
1473 'fields_options' => $bg_image_field_options,
1474 ]
1475 );
1476
1477 $this->add_control(
1478 'background_border_background_overlay',
1479 [
1480 'label' => esc_html__( 'Background Overlay', 'elementor' ),
1481 'type' => Controls_Manager::HEADING,
1482 'separator' => 'before',
1483 ]
1484 );
1485
1486 $this->add_group_control(
1487 Group_Control_Background::get_type(),
1488 [
1489 'name' => 'background_border_background_overlay_group',
1490 'types' => [ 'classic', 'gradient' ],
1491 'selector' => '{{WRAPPER}} .e-link-in-bio__bg-overlay',
1492 'fields_options' => $bg_overlay_image_field_options,
1493 ]
1494 );
1495
1496 $this->add_responsive_control(
1497 'background_overlay_opacity',
1498 [
1499 'label' => esc_html__( 'Opacity', 'elementor' ),
1500 'type' => Controls_Manager::SLIDER,
1501 'range' => [
1502 '%' => [
1503 'max' => 1,
1504 'min' => 0.10,
1505 'step' => 0.01,
1506 ],
1507 ],
1508 'default' => [
1509 'unit' => '%',
1510 'size' => 0.5,
1511 ],
1512 'condition' => [
1513 'background_border_background_overlay_group_background!' => '',
1514 ],
1515 'selectors' => [
1516 '{{WRAPPER}} .e-link-in-bio' => '--background-overlay-opacity: {{SIZE}};',
1517 ],
1518 ]
1519 );
1520
1521 $this->add_borders_control(
1522 'background',
1523 [
1524 'selectors' => [],
1525 'separator' => 'before',
1526 ],
1527 [
1528 'selectors' => [
1529 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-border-width: {{SIZE}}{{UNIT}};',
1530 ],
1531 ],
1532 [
1533 'selectors' => [
1534 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-border-color: {{VALUE}};',
1535 ],
1536 ]
1537 );
1538
1539 $this->add_control(
1540 'background_dimensions',
1541 [
1542 'label' => esc_html__( 'Dimensions', 'elementor' ),
1543 'type' => Controls_Manager::HEADING,
1544 'separator' => 'before',
1545 ]
1546 );
1547
1548 $this->add_control(
1549 'advanced_layout_full_width_custom',
1550 [
1551 'label' => esc_html__( 'Full Width', 'elementor' ),
1552 'type' => Controls_Manager::SWITCHER,
1553 'label_on' => esc_html__( 'Yes', 'elementor' ),
1554 'label_off' => esc_html__( 'No', 'elementor' ),
1555 'default' => '',
1556 ]
1557 );
1558
1559 $this->add_responsive_control(
1560 'advanced_layout_width',
1561 [
1562 'label' => esc_html__( 'Layout Width', 'elementor' ) . ' (px)',
1563 'type' => Controls_Manager::SLIDER,
1564 'size_units' => [ 'px' ],
1565 'range' => [
1566 'px' => [
1567 'min' => 0,
1568 'max' => 500,
1569 'step' => 1,
1570 ],
1571 ],
1572 'default' => [
1573 'unit' => 'px',
1574 ],
1575 'condition' => [
1576 'advanced_layout_full_width_custom' => '',
1577 ],
1578 'selectors' => [
1579 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-container-width: {{SIZE}}{{UNIT}};',
1580 ],
1581 ]
1582 );
1583
1584 $this->add_responsive_control(
1585 'advanced_layout_content_width',
1586 [
1587 'label' => esc_html__( 'Content Width', 'elementor' ) . ' (px)',
1588 'type' => Controls_Manager::SLIDER,
1589 'size_units' => [ 'px' ],
1590 'range' => [
1591 'px' => [
1592 'min' => 0,
1593 'max' => 400,
1594 'step' => 1,
1595 ],
1596 ],
1597 'default' => [
1598 'unit' => 'px',
1599 ],
1600 'selectors' => [
1601 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-content-width: {{SIZE}}{{UNIT}};',
1602 ],
1603 ]
1604 );
1605
1606 $this->add_control(
1607 'advanced_layout_full_screen_height',
1608 [
1609 'label' => esc_html__( 'Full Screen Height', 'elementor' ),
1610 'type' => Controls_Manager::SWITCHER,
1611 'label_on' => esc_html__( 'Yes', 'elementor' ),
1612 'label_off' => esc_html__( 'No', 'elementor' ),
1613 'return_value' => 'yes',
1614 'default' => '',
1615 'condition' => [
1616 'advanced_layout_full_width_custom' => 'yes',
1617 ],
1618 ],
1619 );
1620
1621 $configured_breakpoints = $this->get_configured_breakpoints();
1622
1623 $this->add_control(
1624 'advanced_layout_full_screen_height_controls',
1625 [
1626 'label' => esc_html__( 'Apply Full Screen Height on', 'elementor' ),
1627 'type' => Controls_Manager::SELECT2,
1628 'label_block' => true,
1629 'multiple' => true,
1630 'options' => $configured_breakpoints['devices_options'],
1631 'default' => $configured_breakpoints['active_devices'],
1632 'condition' => [
1633 'advanced_layout_full_width_custom' => 'yes',
1634 'advanced_layout_full_screen_height' => 'yes',
1635 ],
1636 ]
1637 );
1638
1639 $this->end_controls_section();
1640 }
1641
1642 protected function add_identity_image_profile_controls( array $condition ): void {
1643 $config = static::get_configuration();
1644
1645 $this->add_responsive_control(
1646 'identity_image_size',
1647 [
1648 'label' => esc_html__( 'Image Size', 'elementor' ),
1649 'type' => Controls_Manager::SLIDER,
1650 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1651 'range' => [
1652 'px' => [
1653 'min' => 0,
1654 'max' => $config['style']['identity_section']['profile_image_max'] ?? 150,
1655 ],
1656 ],
1657 'default' => [
1658 'unit' => 'px',
1659 ],
1660 'condition' => $condition,
1661 'selectors' => [
1662 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-identity-image-profile-width: {{SIZE}}{{UNIT}};',
1663 ],
1664 ]
1665 );
1666
1667 if ( $config['style']['identity_section']['has_profile_image_shape'] ) {
1668 $this->add_control(
1669 'identity_image_shape',
1670 [
1671 'label' => esc_html__( 'Image Shape', 'elementor' ),
1672 'type' => Controls_Manager::SELECT,
1673 'default' => 'circle',
1674 'options' => [
1675 'circle' => esc_html__( 'Circle', 'elementor' ),
1676 'square' => esc_html__( 'Square', 'elementor' ),
1677 ],
1678 'condition' => $condition,
1679 ]
1680 );
1681 }
1682
1683 $this->add_borders_control(
1684 'identity_image',
1685 [
1686 'condition' => $condition,
1687 ],
1688 [
1689 'condition' => $condition,
1690 'selectors' => [
1691 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-identity-image-profile-border-width: {{SIZE}}{{UNIT}};',
1692 ],
1693 ],
1694 [
1695 'condition' => $condition,
1696 'selectors' => [
1697 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-identity-image-profile-border-color: {{VALUE}};',
1698 ],
1699 ]
1700 );
1701 }
1702
1703 protected function add_identity_image_cover_control( array $condition ): void {
1704 $this->add_responsive_control(
1705 'identity_image_height',
1706 [
1707 'label' => esc_html__( 'Image Height', 'elementor' ),
1708 'type' => Controls_Manager::SLIDER,
1709 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
1710 'range' => [
1711 'px' => [
1712 'min' => 0,
1713 'max' => $config['style']['identity_section']['cover_image_max'] ?? 1000,
1714 'step' => 1,
1715 ],
1716 '%' => [
1717 'min' => 0,
1718 'max' => 100,
1719 ],
1720 ],
1721 'default' => [
1722 'unit' => 'px',
1723 ],
1724 'condition' => $condition,
1725 'selectors' => [
1726 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-identity-image-cover-height: {{SIZE}}{{UNIT}};',
1727 ],
1728 ]
1729 );
1730
1731 $this->add_borders_control(
1732 'identity_image_bottom',
1733 [
1734 'condition' => $condition,
1735 'label' => esc_html__( 'Bottom Border', 'elementor' ),
1736 ],
1737 [
1738 'condition' => $condition,
1739 'selectors' => [
1740 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-identity-image-cover-border-bottom-width: {{SIZE}}{{UNIT}};',
1741 ],
1742 ],
1743 [
1744 'condition' => $condition,
1745 'selectors' => [
1746 '{{WRAPPER}} .e-link-in-bio' => '--e-link-in-bio-identity-image-cover-border-color: {{VALUE}};',
1747 ],
1748 ]
1749 );
1750 }
1751 }
1752