Logging back into WordPress after logging out and having issues with ‘loggedout=true’ in redirect URL
Logging back into WordPress after logging out and having issues with ‘loggedout=true’ in redirect URL
Logging back into WordPress after logging out and having issues with ‘loggedout=true’ in redirect URL
You need to be sure that you have noted global $noCookiesLeft; before setting it in the if statement. It may be unset when it runs the no_cookie() function.
The wp_logout() function is pluggable. You should be able to write your own version and “overload” the Core function: function wp_logout() { $lid = get_current_user_id(); wp_destroy_current_session(); wp_clear_auth_cookie(); do_action( ‘wp_logout’ ); /** * Fires after a user is logged-out. * * @since 1.5.0 */ if (2 == $lid) { wp_redirect(home_url(“/redirectTo”)); exit; } }
Try using wp_redirect after logout. There’s an example of how to use it here. add_action( ‘wp_logout’, ‘auto_redirect_external_after_logout’); function auto_redirect_external_after_logout(){ wp_redirect( ‘http://redirect-url’ ); exit(); }
You could create a custom Page template which contains only the logout code, no call to header.php etc. When you load the /member-logout/ page you’re probably calling the default page.php template which is loading header.php etc. If instead you apply your custom Page template it will just perform the logout action and can then redirect, … Read more
wp_logout_url($uri) having two redirect values
It could be a number of things. Do you check if the user is logged in on the relevant pages? For example: is_user_logged_in() || auth_redirect();
You might have to trigger wp_logout() yourself in that case: if ( $pagenow == “wp-login.php” && $_SERVER[‘REQUEST_METHOD’] == ‘GET’ ) { if ( (isset($_GET[‘action’])) && ($_GET[‘action’] == ‘logout’) ) { wp_logout(); } wp_redirect($new_login_page_url); exit; } That said, it sounds like a real pain to reinvent wp-login.php and handle the different form actions etc… a plugin … Read more
Well, for those who are curious, and to the best of my knowledge/investigation: it turns out this was a strange bug/issue of Chrome Portable* version 47* I was using on my older laptop. It does not happen in other browsers and regular Chrome installation. (with Windows XP, because of EOL support)
wp_logout() not working after form submission