Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Created October 15, 2014 19:15
Show Gist options
  • Save bentasm1/45e11b2f39b8a5ae403f to your computer and use it in GitHub Desktop.
Save bentasm1/45e11b2f39b8a5ae403f to your computer and use it in GitHub Desktop.
Vendor Dashboard Redirect after Login
add_filter('woocommerce_login_redirect', 'login_redirect', 10, 2);
function login_redirect( $redirect_to, $user ) {
if ( WCV_Vendors::is_vendor( $user->id ) ) {
$redirect_to = '/seller_dashboard';
return $redirect_to;
} else {
$redirect_to = 'my-account';
return $redirect_to;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment