Hi all,
I've been trying to force anybody in the admin panel to logout. :) Actually I want to use this for a different purpose(security) but for the basic, I'd need to get through this step.
I expected the following code does the job but it doesn't.
function force_logout () {
wp_clearcookie();
do_action('wp_logout');
nocache_headers();
$redirect_to = 'wp-login.php';
wp_redirect($redirect_to);
exit();
}
add_action ('admin_head', 'force_logout');
Does anybody know the solution for this?