Skip to content

Instantly share code, notes, and snippets.

@fervous
Last active March 22, 2017 15:27
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/267c30de4d0ac0342b37e140d6bab877 to your computer and use it in GitHub Desktop.
Save fervous/267c30de4d0ac0342b37e140d6bab877 to your computer and use it in GitHub Desktop.
redirect to pro dashboard on login wc vendors
/* 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') && WCV_Vendors::is_vendor( $user->id ) ) {
$redirect_to = get_permalink(WC_Vendors::$pv_options->get_option( 'vendor_dashboard_page' ));
}
return $redirect_to;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment