Created
June 2, 2020 08:26
-
-
Save andrewlimaza/3bc8a41feed5de1cf2a482e23069e923 to your computer and use it in GitHub Desktop.
Redirect users after logout WordPress
This file contains 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 | |
/** | |
* Redirect users to home page after logging out of WordPress. | |
*/ | |
function my_redirect_after_logout_wp(){ | |
wp_redirect( home_url() ); | |
exit; | |
} | |
add_action('wp_logout','my_redirect_after_logout_wp'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment