I found a handy redirect function which I would like to share with you all!
If you want a user to visit the the frontpage during logout, place this into your functions.php in your current theme directory:
add_action('wp_logout','go_home'); function go_home(){ wp_redirect( home_url() ); exit(); }
A neat trick, if you have php version above 5.3 then you can write an anonymous function which is more compact:
add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));
Recent Comments