Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Created May 15, 2018 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plugin-republic/a3581887d5f5744459717534ee61e6da to your computer and use it in GitHub Desktop.
Save plugin-republic/a3581887d5f5744459717534ee61e6da to your computer and use it in GitHub Desktop.
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