Home / Admin / Redirecting Vendors to Vendor Dashboard on Login
Duplicate Snippet

Embed Snippet on Your Site

Redirecting Vendors to Vendor Dashboard on Login

Snippet To Redirect Vendors to their Dashboard on login

Code Preview
php
<?php
add_filter('woocommerce_login_redirect', 'login_redirect', 10, 2);
function login_redirect( $redirect_to, $user ) {
// WCV dashboard — Uncomment the 3 lines below if using WC Vendors Free instead of WC Vendors Pro
if (class_exists('WCV_Vendors') && WCV_Vendors::is_vendor( $user->;ID ) ) {
$redirect_to = get_permalink( get_option( 'wcvendors_vendor_dashboard_page_id' ) );
}
return $redirect_to;
}

Comments

Add a Comment