Skip to content

Commit bbeea3a

Browse files
feat: added login url logic
1 parent b62ad75 commit bbeea3a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

widgets/clickdrop.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ protected function register_controls()
7777
'placeholder' => esc_html__('Login', 'animation-addons-for-elementor'),
7878
]
7979
);
80+
$this->add_control(
81+
'login_url',
82+
[
83+
'label' => esc_html__('Login Link', 'animation-addons-for-elementor'),
84+
'type' => Controls_Manager::TEXT,
85+
'placeholder' => esc_html__('https://crowdytheme.com/login', 'animation-addons-for-elementor'),
86+
]
87+
);
8088
$this->add_control(
8189
'logged_label',
8290
[
@@ -185,7 +193,7 @@ protected function register_controls()
185193
],
186194
],
187195
'color' => [
188-
'default' => '#000000',
196+
'default' => '#000000',
189197
],
190198
],
191199
]
@@ -434,8 +442,10 @@ protected function render()
434442

435443
if (!is_user_logged_in()) {
436444
?>
437-
<a href="<?php echo esc_url(wp_login_url()); ?>"
438-
class="aae-clickdrop-btn"><?php echo esc_html($settings['login_label']); ?></a>
445+
<a href="<?php echo esc_url( !empty($settings['login_url']) ? $settings['login_url'] : wp_login_url() ); ?>"
446+
class="aae-clickdrop-btn">
447+
<?php echo esc_html($settings['login_label']); ?>
448+
</a>
439449
<?php
440450
} else {
441451
?>
@@ -478,7 +488,8 @@ class="aae-clickdrop-btn"><?php echo esc_html($settings['login_label']); ?></a>
478488

479489
?>
480490

481-
<li class="<?php echo esc_attr($item_class); ?>" style="<?php echo esc_attr($border_style); ?>">
491+
<li class="<?php echo esc_attr($item_class); ?>"
492+
style="<?php echo esc_attr($border_style); ?>">
482493
<a href="<?php echo esc_url($url); ?>"<?php echo $is_external . $nofollow; ?>>
483494
<?php
484495
if (!empty($item['menu_icon']['value'])) {

0 commit comments

Comments
 (0)