Skip to content

Instantly share code, notes, and snippets.

@fervous
Created March 28, 2017 02:32
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 fervous/504b2c9c760c54cf6d5ea414b802d444 to your computer and use it in GitHub Desktop.
Save fervous/504b2c9c760c54cf6d5ea414b802d444 to your computer and use it in GitHub Desktop.
redirect to pro dashbaord after login wc vendors pro
/* Redirect Vendors to Vendor Dashboard on Login */
add_filter('woocommerce_login_redirect', 'login_redirect', 10, 2);
function login_redirect( $redirect_to, $user ) {
if (class_exists('WCV_Vendors') && class_exists('WCVendors_Pro') && WCV_Vendors::is_vendor( $user->id ) ) {
$redirect_to = get_permalink(WCVendors_Pro::get_option( 'dashboard_page_id' ));
}
return $redirect_to;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment