Skip to content

Instantly share code, notes, and snippets.

@fervous
Last active September 27, 2016 20:02
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/feb3a043c399b0b1fb18f9488e75aed8 to your computer and use it in GitHub Desktop.
Save fervous/feb3a043c399b0b1fb18f9488e75aed8 to your computer and use it in GitHub Desktop.
wc vendors free login redirect
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