PluginProbe
Elementor Website Builder – more than just a page builder / 3.22.0-beta1
Elementor Website Builder – more than just a page builder v3.22.0-beta1
4.3.4 4.3.3 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 All 457 releases
elementor / modules / conversion-center / base / widget-link-in-bio-base.php

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

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