Created
September 4, 2024 23:46
-
-
Save alexdeborba/30dc742a2ac4124fd3c098c0404ea388 to your computer and use it in GitHub Desktop.
Redirect to homepage after logout
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
// Redirect to homepage after logout | |
function custom_logout_redirect() { | |
wp_redirect(home_url()); | |
exit(); | |
} | |
add_action('wp_logout', 'custom_logout_redirect'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment