Forked from gbot/woocommerce-login-logout-redirects.php
Created
August 15, 2017 05:29
-
-
Save chandra10207/8915d4410ffd2c70fe9067e5e72c27e6 to your computer and use it in GitHub Desktop.
WP: Redirect to home page for WooCommerce login and logout. #ST3
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
/*----------------------------------------------------------------------------*/ | |
// redirects for login / logout | |
/*----------------------------------------------------------------------------*/ | |
add_filter('woocommerce_login_redirect', 'login_redirect'); | |
function login_redirect($redirect_to) { | |
return home_url(); | |
} | |
add_action('wp_logout','logout_redirect'); | |
function logout_redirect(){ | |
wp_redirect( home_url() ); | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment