Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ahigh4life/538a1d3ff048fbfa3bbb32d2e3811e6b to your computer and use it in GitHub Desktop.
Save Ahigh4life/538a1d3ff048fbfa3bbb32d2e3811e6b to your computer and use it in GitHub Desktop.
WP: Redirect to home page for WooCommerce login and logout. #ST3
/*----------------------------------------------------------------------------*/
// 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