Instantly share code, notes, and snippets.

Embed
What would you like to do?
function cwc_login_redirect( $redirect, $user ) {
if( strpos( $redirect, 'wp-admin/admin-ajax.php' ) !== false ) {
$redirect = home_url();
}
return $redirect;
}
add_filter( 'woocommerce_login_redirect', 'cwc_login_redirect', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment