Questions tagged [logout]
The logout tag has no summary.
140 questions
0 votes
0 answers
39 views
Add a ‘Logout’ button under a Parent Menu
I triy to add a ‘logout’ button on the main nav menu under ‘account’ parent menu. But, the button does not rendor. At Appearance > Menus, I add ‘account’ page to the active menu. (link enabled) I ...
0 votes
1 answer
82 views
How to invalidate wordpress_logged_in cookie via backchannel logout
We run WordPress with the OpenID Connect Generic Client plug-in to provide SSO using Keycloak. Currently, we are looking for a way to log users out of WordPress without having them visit WordPress in ...
1 vote
1 answer
79 views
wp_logout function not executed
Context: a custom plugin My goal: i need to redirect user to another site after a logout I wrote these error_log("test of error logging"); add_action('wp_logout', function () { error_log(&...
0 votes
1 answer
86 views
Force logout when role is changed
I'd like to forcefully log users out when their role is changed. For example, if a user is logged into the site and has an existing role of 'Editor' and I change the role to 'No role for this site', ...
1 vote
0 answers
126 views
Nonce verification problem when logging in after a logout
I'm having a problem with nonce verification. The theme I'm using has an AJAX login form that has nonce as a hidden field. It normally goes to my account page after a logout, and I can re-login from ...
0 votes
1 answer
505 views
Unable to logout correctly after wp-login file was modified
I'm using a custom url for the login of my WordPress site. I've added this code in my functions.php file /** Hide default login */ function hide_default_login() { //Only proceed for guests if ...
0 votes
1 answer
193 views
Changing login url
I've been following this guide on how to change your login url : https://www.malcare.com/blog/change-wordpress-login-url/ However, upon adding the logout, login and lost password hooks, I've noticed ...
0 votes
1 answer
195 views
Logout redirect via page template without confirmation?
I'm trying to redirect users when they visit my page template template-logout.php, but I keep getting the Wordpress "Do you really want to logout?" question despite wpnonce being generated. ...
1 vote
1 answer
1k views
Logout button in menu without "wp" in links
Update: This question was initially about how to log a user out without confirmation, but from a "pretty" URL without a logout nonce. However, in retrospect I realize this is a security ...
0 votes
2 answers
2k views
Can i hide a dynamically created div to logged out users?
Is it possible to hide a specific dynamically created div from user that is logged out? I have tried this but doesnt work: <?php if (is_user_logged_in()): ?> var element = document....
0 votes
0 answers
40 views
Inconsistent login state
I'm logged in with "Remember me" checked. I then click the logout link. At this point I appear to be logged out - I can no longer access member-only pages, and menus that only appear for ...
1 vote
2 answers
883 views
Force logout ALL users at a certain time
I'm wondering if it's possible to logout all users 2 times a day using the function wp_logout() ? I see loads of plugins who can logout idled users but we want to log out every single users twice a ...
0 votes
1 answer
677 views
add class to element if user is not logged in [closed]
Please help . I need to add class to this button if user is not logged in <?php echo apply_filters( 'my_order_html', '<button type="submit" class="ADD-CLASS-HERE cfw-primary-btn ...
0 votes
0 answers
35 views
Multiple use wp_logout_url() on page cause 'header already sent' error after submit form
I am using two wp_logout_url() echoes on page. The first one is used in header.php custom theme file, second one is used in another page template file (page-[customslug].php). On that page i have a ...
0 votes
1 answer
334 views
wp_logout hook never triggered
Long story short. In wp-config.php: define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', false); define('WP_DEBUG_LOG', true); In the main file of my plugin, in the constructor: public function ...