Last active
March 22, 2017 15:27
-
-
Save fervous/267c30de4d0ac0342b37e140d6bab877 to your computer and use it in GitHub Desktop.
redirect to pro dashboard on login wc vendors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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