PluginProbe
Elementor Website Builder – more than just a page builder / 3.24.4
Elementor Website Builder – more than just a page builder v3.24.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.24.4, at modules/link-in-bio/base/widget-link-in-bio-base.php

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