Add option to login form #23126
JennyPower
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Prerequisites
What problem is your feature request going to solve? Please describe.
It would be great if there was an option on the login form to just have a log out link.
This would allow for a logout link in the top right of the header which is a typical use case - it would not be typical to have the whole login form there.
Describe the solution you'd like
An option of 'Logout only'
Describe alternatives you've considered
The only other way I've found to achieve this in Elementor (with bypassing the logout confirmation) is to create a shortcode and use a shortcode widget:
function dynamic_login_logout_url() {
if (is_user_logged_in()) {
$url = wp_logout_url(get_permalink()); // User will be redirected to the current page after logout
$link_text = 'Logout';
} else {
$url = wp_login_url();
$link_text = 'Login';
}
$link = '' . $link_text . '';
}
add_shortcode('dynamic_login_logout_url', 'dynamic_login_logout_url');
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions