Created
August 9, 2016 12:59
-
-
Save andrewlimaza/7070202d6487a7924ade2cde4a52ae3f to your computer and use it in GitHub Desktop.
Redirect users to home page when logging out of WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//copy lines 5 onwards into your active theme's function.php or custom plugin for code snippets. | |
function my_logout_go_home(){ | |
wp_redirect( home_url() ); | |
exit(); | |
} | |
add_action( 'wp_logout', 'my_logout_go_home' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment