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

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