Logout redirects to /forums/

I discovered the Hikari Hooks Troubleshooter (http://hikari.ws/hooks-troubleshooter/) this weekend to find what plugins were loading my header with competing open graph metadata. Enable it, and visit the frontend. There will be a modal dialog over your site which should list the hooks into wp_logout. One of these will be the offending plugin. If you’re still … Read more

Logout using link (without nonce)

This will disable nonce checking for logging out – on your head be it: add_action( ‘login_form_logout’, function () { $user = wp_get_current_user(); wp_logout(); if ( ! empty( $_REQUEST[‘redirect_to’] ) ) { $redirect_to = $requested_redirect_to = $_REQUEST[‘redirect_to’]; } else { $redirect_to = ‘wp-login.php?loggedout=true’; $requested_redirect_to = ”; } /** * Filters the log out redirect URL. * … Read more

Force logout ALL users at a certain time

This should be possible, WordPress provides the WP_Session_Tokens class to manage logged in sessions. Then it’s just a matter of connecting it to the cron. The following is a simple plugin file which I think should do it. Add it to the plugins directory and it should start working. *not tested. <?php /* Plugin Name: … Read more

Deleting cookie to logout

You can log out the current user with wp_logout() function: I think it is much better approach. wp_logout() destroys current session, clears authorization cookie and call wp_logout action. Also, it is a pluggable function, which means can be redefined by plugins. You can miss important stuff, specially when working in combination with other plugins. If … Read more

wp_logout not redirecting using wp_logout_url() and wp_redirect()

The correct method for changing the logout redirect is the logout_redirect filter: /** * Filters the log out redirect URL. * * @since 4.2.0 * * @param string $redirect_to The redirect destination URL. * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. * @param WP_User $user The WP_User object for the … Read more