PluginProbe
Elementor Website Builder – more than just a page builder / 3.23.0-dev3
Elementor Website Builder – more than just a page builder v3.23.0-dev3
4.3.2 4.3.1 4.3.0 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 All 455 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.23.0-dev3, at modules/link-in-bio/base/widget-link-in-bio-base.php

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