• I spent a couple hours trying to sort this so hopefully it helps someone. I needed have a couple of processes run before the logout completed on a current user. This action hook ‘clear_auth_cookie’ runs prior to the logout function which still gives you access to the current user.

    function custom_logout_function(){
    	global $current_user;
    	// your functions / process here
    
    }
    add_action('clear_auth_cookie', 'custom_logout_function',1);

    Hope it helps!

The topic ‘Hooking into logout – wp_logout …’ is closed to new replies.