Conditional redirection with logout

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; } }

wp_logout problem

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

Redirection of wp-login.php results in non working of Logout process

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)